Enhancement of test script robustness

Web UI tests in HCL OneTest UI might encounter issues with object recognition during playback, that can lead to test failures or errors. To address the issues and to improve test robustness, you can use various methods.

One common reason for step failure is when the version of an application changes. For example, if a test was recorded with an earlier version of an application and you playback the test in a newer version of the application that has updated objects or object locations, HCL OneTest UI might fail to recognize the new objects during the playback. Another factor that contributes to step failures is the variation in data between the time of recording and playback. For example, the date and time when the test was recorded can be different from the date and time during the test playback.

To enhance the robustness of your test scripts, you can consider to implement the following methods:

  • Modifying object identification
    • You can modify and select a more suitable property and value for the target objects within test steps so that HCL OneTest UI can identify the objects easily during the test playback. See Object properties.
    • You can use images as the main property for step targets or modify the generated images in a test so that HCL OneTest UI can identify images easily during the test playback. See Image recognition in a test.
    • You can use regular expressions to replace recognition properties in verification points. See Assigning a test variable to an object property.
  • Adding object locator conditions

    You can include object locator conditions within test steps so that HCL OneTest UI can locate the target objects easily during the test playback. See Object location in a test.

  • Applying Responsive Design conditions

    You can include the Responsive Design conditions for actions in tests that should be executed only once during the test playback. See Responsive design condition.

  • Performing asynchronous actions

    You can select the Perform asynchronously option in a test for certain actions of objects such as click, hover, press Enter, and so on so that the actions are performed asynchronously during the test playback. See Actions performed asynchronously.

  • Using regular expressions for dynamic elements

    You can use regular expressions to identify dynamic titles and URLs of multiple windows. See Identification of dynamic window titles.

By using these methods, you can enhance the robustness of your test scripts.