Validations

LoadGen is a load-testing tool that allows you to validate the performance of your Windows application or website under various levels of simulated user traffic. One key aspect of load testing is control validation, which involves verifying that the controls on your application or website are functioning as expected under the increased load.
 
A validation is a visual indication that a process has finished. We advise you to add as many validations as possible. As - under load, anything will break - a user action can take an extra amount of time as the load on a machine will increase. 
 
These indications are one of the following:
 

Caption of the foreground window validation

he appearance or disappearance of a window caption in the session; A window caption validation will look at the top-level window of a session. In the Studio options, you will find ways to control how to match a window caption. Options include the location of a match, whether a comparison should be case-sensitive, and whether to use regular expressions instead of a line of text.

 

Control in the foreground window validation

This feature is available for Fat Client, Citrix Enhanced, Remote Desktop, VMware Horizon, and Azure Virtual Desktop. It involves the appearance of a control in the top foreground window; in Fat Client, you can choose a control from the window, e.g., an OK button, text, etc. Control validation is the most robust way of validating a user-specific action. With the LoadGen Q4-2022 release, we go a step further!
 

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:

  1. 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.
  2. Target specific controls: Whenever possible, interact directly with known controls using unique identifiers, reducing the need for deep or broad searches.
  3. Optimize UI structure: When feasible, design applications with a flatter UI hierarchy, minimizing the number of nested controls to enhance accessibility and performance.
  4. 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

There are four methods of control validation that LoadGen offers:
  1. 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.
  2. 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.
  3. 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.
  4. 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.
When using LoadGen's control validation feature, you can specify which control to validate if multiple controls are found at the same level with the same name. By default, LoadGen will validate the first control found with the selected name (equivalent to specifying the Nth control as 0). However, you can change this behavior by specifying a different value for the Nth control.
 
For example, if you want to validate the first control found with a given name, you can specify the Nth control as 1. If you want to validate the second control, you can specify the Nth control as 2, and so on. This can be useful if you have multiple controls with the same name and want to validate a specific one.
 
To specify the Nth control in LoadGen, you can use the "Nth control" parameter in the control validation settings. Enter the desired value for the Nth control, and LoadGen will validate the control at the specified position within the list of controls with the same name.
Overall, this option allows you to fine-tune your control validation strategy and ensure that you are testing the specific controls that are important to your application or website.

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:

  1. Identify target control: During the validation process, select a UI control (e.g., text box, label, or button).
  2. Retrieve value: LoadGen stores the control's value in the LastControlValue variable.
  3. 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.

DN-2971.png

Image validation

An image appears in an area of the session. An image search will repeatedly search an area of the session for a predefined image. When it finds the image, the validation will succeed, and the X and Y coordinates of the found location are available in the Last Validation>< and Last Validation Y variables.

 

Single Pixel validation

An RGB color of a specific pixel, with a tolerance margin for both color and location RGB color validation, will look at the RGB value of a pixel in the session. You can choose a pixel when you create a validation, and the script will wait for a match on RGB values when running. Options for RGB matching include a tolerance margin, in percentages, for each RGB value of a pixel. This percentage is calculated over the co or range of 0-255. Other options include a location margin; this is the number of pixels around the given coordinate that the script vvi1 00k for a match. The search pattern is snake-like, starting at the top left and walking around the pixel clockwise.
 

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  1. 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.
  2. 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.
  3. 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.
Was this article helpful?
3 out of 4 found this helpful