Class SwingDriver

  • Direct Known Subclasses:
    SwingDriverInternal

    public class SwingDriver
    extends UiDriver
    A driver used for working with a SWING application
    • Field Detail

      • windowTitle

        protected String windowTitle
      • jnlpLocation

        protected String jnlpLocation
      • isJnlpCached

        protected boolean isJnlpCached
      • windowFixture

        protected org.fest.swing.fixture.WindowFixture<? extends Window> windowFixture
        Current window container. Used also when closing application at the test end
      • currentContainer

        protected org.fest.swing.fixture.ContainerFixture<? extends Container> currentContainer
        Current container context used for searching of other components
    • Constructor Detail

      • SwingDriver

        protected SwingDriver​(String windowTitile)
        Parameters:
        windowTitile - the window title
      • SwingDriver

        protected SwingDriver​(Class<?> mainClassOfTestedApplication)
        Parameters:
        mainClassOfTestedApplication - the class containing the "main" method
      • SwingDriver

        protected SwingDriver​(Class<?> mainClassOfTestedApplication,
                              String windowTitile)
        Parameters:
        mainClassOfTestedApplication - the class containing the "main" method
        windowTitile - the window title
      • SwingDriver

        public SwingDriver​(String jnlpLocation,
                           boolean cacheEnabled)
        Parameters:
        jnlpLocation - JNLP location. It can be local JNLP file path or a remote url
        cacheEnabled - whether the JNLP is cached or not
    • Method Detail

      • start

        public void start()
        Description copied from class: UiDriver
        start the driver
        Specified by:
        start in class UiDriver
      • stop

        public void stop()
        Description copied from class: UiDriver
        stop the driver
        Specified by:
        stop in class UiDriver
      • stop

        public void stop​(boolean cleanResources)
        Cleans up any used resources (keyboard, mouse, open windows and ScreenLock) used.
        Parameters:
        cleanResources - if true release UI resources
      • getSwingEngine

        public SwingEngine getSwingEngine()
        Returns:
        new SwingEngine instance
      • setCommandDelay

        public void setCommandDelay​(int commandDelay)
        Set the delay time between commands
        NOTE: It also sets this delay time as a default command delay time of UiEngineConfigurator
        Parameters:
        commandDelay - a value representing the delay time between commands (in milliseconds)