Adding a Wait step

You can add Wait as a step in the recorded test for a specified duration. You can specify the wait time in milliseconds, seconds, minutes, or hours. Adding a Wait step gives the application the required time to load the UI elements and update the screen.

Before you begin

You must have completed the following tasks:
  • Ensured that you are assigned a Team Space Owner, Project Owner, or Member with a Tester role to create or edit a test resource.
  • Read and understood the information in Edit branch overview and Create or select an Edit branch.
  • Ensured that your project contains a Web UI test.

Procedure

  1. Click the Edit button displayed on the Test Editor page.

    The Edit button appears only when no active edit branch is selected.

    Alternatively, right-click the test in the test navigator panel and select Edit.

    The Edit branch dialog is displayed.
    If the Edit branch dialog is not displayed, then go to step 3.
  2. Select an existing edit branch or create a new edit branch.
  3. Drag and drop the Wait element under any test step as required from the General catalog in the Catalog tab.
  4. Click the Wait step.
    The step details pane is displayed.
  5. Select the required mode from the Mode list:
    • UI
    • General

    A confirmation dialog is displayed, indicating that switching modes clears the current step configuration.

  6. Click Yes.
    Note:
    • The default mode depends on where the Wait step is added. When the Wait step is added within a With step, it opens in UI mode. When it is added outside a With step, it opens in General mode.
    • You can switch between the available modes by selecting a different option from the Mode list.
    • If you switch modes after configuring the step, select the required mode and then click Yes in the confirmation dialog. The existing configuration is cleared and the step opens in the selected mode.
  7. Perform the following steps to assign a variable to a test element:
    Mode Action
    General: You can use the General mode to add wait time for test steps.
    Perform the following steps:
    1. Specify the amount of time that the step must pause in Duration.
    2. Select the unit of time for the timeout in Unit.
    3. Alternatively, you can select the Code checkbox to enter the time and unit in the Duration text box.
    4. Optional: Enter a message to indicate the reason for the pause in the Note text box.
    UI: In the UI mode, the test run pauses at the Wait step until the targeted UI element is identified.
    Perform the following steps:
    1. Select an object by dragging and dropping an element from Smartshot view, an element from Elements list, or a property-value pair from the Properties list.

      Alternatively, you can select an object from the list in UI Object, and then select an identifier such as Class, Content, Label, XPath, or Id of the object from the list. If you follow this method, you must ensure that the object is highlighted in the Smartshot view after you enter the values.

      You can replace the value of identifier dynamically under the Object Identified By section by clicking the Insert Variable icon Insert Variable and selecting a variable from the list.

      Note:
      The Insert Variable option is available only in UI mode.
    2. Optional: Click the Click here to add relative to link, specify the relative location in the Location field, and specify the relative object in the UI Object field.
    3. Optional: Click the Click here to add alternative identifier link, and select a target object from the list in the Target 2 field.

      Alternatively, you can drag and drop an element from the Smartshot view.

    4. Optional: Select the Override Timeout checkbox in the Advanced tab and increase the timeout value in Duration for the object verification.
  8. Click the Save icon to save the modifications.

Results

You have added a Wait step to pause the test for a specific duration.

What to do next

You can run the test and view the results. See Running a Web UI test.