Slowing Down Tests

Some applications under test might require extensive loading of application data in the UI, and might not be finished on time with loading objects that are required for replaying a test. To successfully replay tests on such an AUT, you can check for the existence of an object before performing an action on it, or you can add sleeps before performing an action.

Note: Micro Focus does not recommend generally adding sleeps to tests, because in most cases Silk4NET will automatically detect if an object is available, and sleeps might severely reduce the performance of tests.
  1. To check if an object is available in the AUT, use the Exists method. For example, to wait for six seconds for the button INPUT to become available, add the following line to your test script:
    'VB .NET code
    browserWindow.Exists("//INPUT", 6000)
    // C# code
    browserWindow.Exists("//INPUT", 6000)
  2. To add a sleep before performing an action on a control, use the method. For example, to sleep for six seconds, add the following line to your test script:
    'VB .NET code
    System.Threading.Thread.Sleep(6000)
    // C# code
    browserWindow.Exists("//INPUT", 6000)