Timeout configuration

The Storefront Test Automation Engine can be configured to prevent tests from waiting too long.

Some test failure conditions can cause some operations to take too much time to complete or even freeze parts of the environment.

To prevent tests from waiting too long, you can configure the following timeout values in the configuration properties file. The value in the properties file is denoted in brackets:
  • Page Load Timeout (PAGE_LOAD_TIMEOUT_SECONDS): Determines the maximum amount of time – in seconds – that a single page is expected to fully load. Verifies that a page loaded within this timeout value. If not, an exception is thrown, and the test case fails.
  • Implicit Timeout (IMPLICIT_TIMEOUT_SECONDS): Finds elements on a page that are already loaded. This value is kept at 0 or 1 second to prevent failures on slow systems.
  • AJAX Timeout(AJAX_TIMEOUT_SECONDS): Time to wait for an Ajax call to complete when you find an element on the page that depends on a completion of an Ajax call.
  • Script Timeout(SCRIPT_TIMEOUT_SECONDS) : Time to wait for non-AJAX calls, such as JavaScript to complete when you find elements.

These timeout values are used in the page objects classes to ensure that the framework waits for the appropriate amount of time before it fails the test cases if an expected element was not found. For example:

   /**
   * opens the mini shop cart widget
   * 
   * @return this header
   */
   public HeaderSection openShopCartWidget()
   {
      getFactory().createQuery(shopcartWidget).findExactlyOne().focusAndClick();
      getFactory().createQuery(shopcartPopup).withinScriptTimeout().findExactlyOne();
   return this;
   }