Class UiEngineUtilities


  • public class UiEngineUtilities
    extends Object
    Generic utility class
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void createScreenshot​(String filePath, UiDriver uiDriver)
      Create a screenshot image (supported image format/type is PNG).
      If the screenshot image file already exists it will be automatically replaced by the new one.

      Currently the supported UI drivers are AbstractRealBrowserDriver and MobileDriver: AbstractRealBrowserDriver - the method makes a best effort to create a screenshot, depending on the browser to return the following in order of preference: Entire page Current window Visible portion of the current frame The screenshot of the entire display containing the browser MobileDriver - creates a screenshot of the mobile device screen.
      NOTE: There is a known issue on Android Virtual Device with "Use Host GPU" enabled option.
      static void sleep()
      Sleep for period equal to the UI commands delay as defined in the UI Engine configuration
      static void sleep​(int millis)
      Sleep for the specified number of milliseconds
    • Constructor Detail

      • UiEngineUtilities

        public UiEngineUtilities()
    • Method Detail

      • sleep

        public static void sleep()
        Sleep for period equal to the UI commands delay as defined in the UI Engine configuration
      • sleep

        public static void sleep​(int millis)
        Sleep for the specified number of milliseconds
        Parameters:
        millis -
      • createScreenshot

        public static void createScreenshot​(String filePath,
                                            UiDriver uiDriver)
        Create a screenshot image (supported image format/type is PNG).
        If the screenshot image file already exists it will be automatically replaced by the new one.

        Currently the supported UI drivers are AbstractRealBrowserDriver and MobileDriver:
        • AbstractRealBrowserDriver - the method makes a best effort to create a screenshot, depending on the browser to return the following in order of preference:
          • Entire page
          • Current window
          • Visible portion of the current frame
          • The screenshot of the entire display containing the browser
        • MobileDriver - creates a screenshot of the mobile device screen.
          NOTE: There is a known issue on Android Virtual Device with "Use Host GPU" enabled option. So in order to get a screenshot it should be disabled. Keep in mind that it will affect the performance, because it is a performance acceleration option.
        Parameters:
        filePath - the screenshot image file path
        uiDriver - UiDriver instance