Caption of the foreground window validation
Control in the foreground window validation
Limit control depth
In Windows applications, the user interface (UI) is structured hierarchically, resembling a tree with parent controls branching into child controls. This hierarchical organization allows for systematic navigation and interaction with UI elements. When automating interactions or measuring user transactions, it's essential to understand and manage the "control depth," which refers to the levels of hierarchy traversed during these operations.
Understanding control depth:
- Level 1 (Depth 1): Interacts only with top-level (parent) controls.
- Level 2 (Depth 2): Includes top-level controls and their immediate child controls.
- Level 3 (Depth 3): Encompasses top-level controls, their children, and the children's children.
- And so forth...
Performance Implications:
As the control depth increases, the number of UI elements to process grows exponentially. This expansion can lead to:
- Increased processing time: Deeper searches require more time to traverse and interact with all relevant controls.
- Impact on user transaction measurements: Extended processing times can skew the perceived performance metrics, leading to inaccurate assessments.
- Load on LoadGen Agent: The agent responsible for automation may experience higher CPU and memory usage, potentially affecting its performance and reliability.
Best Practices:
To optimize performance and ensure accurate measurements:
- Limit control depth: Set the control depth to the minimum level necessary for your operations. For instance, if the required control is within the first two levels, avoid searching beyond depth 2.
- Target specific controls: Whenever possible, interact directly with known controls using unique identifiers, reducing the need for deep or broad searches.
- Optimize UI structure: When feasible, design applications with a flatter UI hierarchy, minimizing the number of nested controls to enhance accessibility and performance.
- Monitor Performance: Regularly assess the performance impact of your automation scripts, adjusting control depths and search strategies as needed to maintain efficiency.
By carefully managing control depth and adopting these best practices, you can enhance the efficiency of your automation tasks, ensure more accurate user transaction measurements, and maintain the LoadGen Agent's optimal performance.
Find controls
- Full Visual Tree: This method involves validating a control within the full visual tree of the application or website. This is a comprehensive approach that ensures that the control can be found in the position it should be available. Keep in mind, that when the title of the application changes (i.e. Document1 - Word changes in My saved document - Word) the full visual tree will change and thus the control will not be found by our validation process.
- Subtree: This method involves validating a specific control with a subset of the visual tree. This can be useful if you only want to test a control from a specific location of your application or website.
- Name and type of a control at control's depth: This method involves validating a specific control based on its name and type, as well as its location (depth) within the visual tree. This can be useful if you want to focus on a specific control but don't want to add a specific visual tree to locate the control.
- Loose search: This method involves searching for a control using partial matches for its name and type. This can be useful if you are not sure of the exact location of the control you want to validate.

Control Value Extraction with LastControlValue
Expanding on LoadGen's powerful control validation capabilities, the new feature, Control Value Extraction, allows you to retrieve the value of a specific control during a workload and store it in the LastControlValue variable. This enhancement provides dynamic verification of UI elements, enabling precise validations and responsive decision-making in your workflows.
How it works:
- Identify target control: During the validation process, select a UI control (e.g., text box, label, or button).
- Retrieve value: LoadGen stores the control's value in the LastControlValue variable.
- Validation and decision-making: Use the retrieved value in conditional workflows to verify against expected outcomes or direct the next steps of the test.
Practical Example:
- After clicking a "Submit" button, retrieve the text from a confirmation label.
- Validate whether equals "Submission Successful."
- If it matches, proceed with the workflow; if not, log the error and halt execution.
This feature seamlessly integrates into LoadGen’s validation methods, offering enhanced flexibility and accuracy. By leveraging LastControlValue, you can optimize your test workflows, ensuring precise, real-time validations without adding complexity.
Image validation
Single Pixel validation
OCR Image Text validation
LoadGen's OCR (Optical Character Recognition) image text validation feature allows users to verify that specific text is present within a defined screen region during load testing. This type of validation is especially useful when working with applications that don't expose controls in the UI or when testing images or PDFs.
Here's a breakdown of the key features of OCR validation:
-
Area to Search: You can select where on the screen the OCR validation should be performed:
- Whole desktop: Searches for text within the entire desktop window.
- Custom: Define a specific area on the screen where the OCR should validate.
- Area Location: Manually input the X and Y coordinates of the area to search.
- Area Size: Define the height and width of the search area in pixels.
-
Difference Percentage: This setting specifies how much difference can occur between successive screenshots before the validation continues with the next screenshot.
It checks for how much the current screenshot differs from the previous one. If the percentage is above the specified threshold, the validation will proceed with the new screenshot. This is especially helpful when working with dynamic content. - Occurrence Count: This setting specifies how often the text block appears on the screen. If the text appears multiple times at the same level, you can define which instance of the text block should be validated.
-
Static Text vs Text Variables: You can use either of the following methods to input text for validation:
- Static Text: Input a specific text string to search for in the designated area.
-
Text Variable's Value: Use a dynamic text variable, which is useful when the text changes during different test runs.
QR Image Text validation
LoadGen Studio’s QR image text validation feature allows you to verify the presence of QR codes or specific text extracted from QR images during automated load-testing scenarios. This type of validation is particularly useful in environments where QR codes are dynamically generated and must be verified quickly and reliably.
Features of QR Validation:
-
Area to Search:
Similar to OCR validation, you can define the area where the QR code will be detected:- Whole desktop: The entire desktop window will be scanned for a QR code or the matching text.
- Custom: You can define a specific area for more precise scanning by adjusting:
- Area Location: Manually set the X and Y coordinates.
- Area Size: Define the height and width of the search area.
-
Static Text or Text Variable:
QR validation allows two modes to verify the extracted information:- Static Text: If the QR code contains predefined text, you can validate it by inputting the specific string.
- Text Variable's Value: If the text varies, you can use a text variable that dynamically adjusts during each test session. This is useful when the QR code content changes but follows a known pattern.
-
QR Image Usage in Documents and Web Applications:
QR validation is a robust and efficient way to validate specific, long-running transactions or operations. It ensures that the QR code, which represents a completed step in a process, is displayed at the right time during the test. This method is especially useful in cases such as:- Web Applications: If your web application generates a QR code after processing a payment or completing a significant user action, QR validation can ensure that the code appears when expected, signaling that the transaction has been successfully processed.
- Internal Documents: When working with PDFs or other documents containing QR codes, LoadGen can quickly verify that the correct QR code is present, ensuring the document is fully processed.