Adding Delays in Automated Test Cases

Updated by Aishwarya Rai

Sometimes during an automated test, loading times from screen to screen can vary between high-end and low-end devices or based on how "heavy or light" an XML may be. To account for differences in loading times, and to prevent the automation from performing an action prematurely, we allow our users to introduce static and dynamic delays between screens where some load time is required.

  1. Time Delays (also known as static delays): Explicit wait times you can add in your tests to account for any predicted, foreseen delays in between test steps
  2. Dynamic Delays (also known as dynamic wait): User-specified duration for Sofy to wait for a component to load or become visible before fetching the layout XML in a given step
  3. Number of Retries: Sofy will retry failed test steps on its own, which is useful for cases where tests may fail due to environment or other one-time issues.
  4. XML Fetch Time: The time required for Sofy to retrieve the XML layout
  5. Total Playback Time: This includes the cumulative time for all processes such as dynamic wait, XML fetch time, XML load time, and other internal processes like initialization, XML processing, screenshot capturing, and UI generation.

Adding Static Delays (also known as "time delays")

To add static delays during an automated test, complete the following three easy steps:

  1. First, simply click on the clock icon, and select the amount of time you'd like to delay by.
  2. To add a delay in an existing test case, open up a test case you wish to add a time delay to:
  3. Hover your mouse between the two screens you wish to add a delay to, click on the clock icon, and select/specify the desired duration for the delay:

Adding Dynamic Delays (also known as "dynamic waits")

Dynamic waits allows you to specify the duration for which Sofy should wait for XML elements to load before proceeding with further actions. It gives you more control over the waiting mechanism, especially useful for screens with heavy XML content.

To add a dynamic wait to a step in your testcase:

  1. Open up your testcase by navigating to the Automation section and then selecting the test:
  2. Open any step in Edit mode to which you want to add a dynamic delay:
  3. In the Edit modal, you will see an option of Dynamic Wait. Click on the pen icon next to it to provide a value for your dynamic wait.
  4. Once you provide the value, click on Save and also save the testcase:
  5. Now when you execute the test, Sofy will wait for the XML to load for the duration you specified in the dynamic wait. You can see the dynamic waiting time, total time for execution of the step and other step execution details in the Step execution / Performance details section of a step inside a test run:


How did we do?