Interface SeleniumVirtualUserInterface

    • Method Detail

      • initialiseWebDriver

        void initialiseWebDriver​(WebDriver driver)
                          throws java.lang.Exception
        Create a new WebDriver instance for this SeleniumVirtualUser.

        This method provides a way to alter the type of WebDriver for this Virtual User.

        Parameters:
        driver - The type of WebDriver to be used by this Virtual User
        Throws:
        java.lang.Exception - An error occurred
      • initialiseHtmlUnitDriver

        void initialiseHtmlUnitDriver()
                               throws java.lang.Exception
        Create a new HtmlUnitDriver instance for this SeleniumVirtualUser.

        The HtmlUnitDriver will be set to use the default BrowserVersion. If you need to impersonate a different BrowserVersion then you can call initialiseHtmlUnitDriver(BrowserVersion) instead.

        Typically, this method is called from the VirtualUser.pre() method.

        Throws:
        java.lang.Exception - An error occurred
      • initialiseHtmlUnitDriver

        void initialiseHtmlUnitDriver​(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
                               throws java.lang.Exception
        Create a new HtmlUnitDriver instance for this SeleniumVirtualUser, impersonating the BrowserVersion specified.

        Typically, this method is called from the VirtualUser.pre() method.

        Parameters:
        browserVersion - The BrowserVersion to impersonate.
        Throws:
        java.lang.Exception - An error occurred
      • initialiseFirefoxDriver

        void initialiseFirefoxDriver()
                              throws java.lang.Exception
        Create a new FirefoxDriver instance for this SeleniumVirtualUser.

        Typically, this method is called from the VirtualUser.pre() method.

        Throws:
        java.lang.Exception - An error occurred
      • initialiseInternetExplorerDriver

        void initialiseInternetExplorerDriver​(java.lang.String pathToIEDriverServer)
                                       throws java.lang.Exception
        Create a new InternetExplorerDriver instance for this SeleniumVirtualUser.

        In order to use the InternetExplorerDriver, you need to install the IE driver server (IEDriverServer.exe) on each injector in your test. You must then pass the full path of the driver server to this method, e.g:

        
         initialiseInternetExplorerDriver("C:/tools/SeleniumDrivers/IEDriverServer.exe");
         
        For more information on setting up the IE driver server, please refer to the documentation on the selenium website.

        Typically, this method is called from the VirtualUser.pre() method.

        Parameters:
        pathToIEDriverServer - The full path to the IE driver server on the injector.
        Throws:
        java.lang.Exception - An error occurred
      • initialiseChromeDriver

        void initialiseChromeDriver​(java.lang.String pathToChromeDriver)
                             throws java.lang.Exception
        Create a new ChromeDriver instance for this SeleniumVirtualUser.

        In order to use the ChromeDriver, you need to install the chrome driver server (chromedriver.exe) on each injector in your test. You must then pass the full path of the driver server to this method, e.g:

        
         initialiseChromeDriver("C:/tools/SeleniumDrivers/chromedriver.exe");
         
        For more information on setting up the chrome driver server, please refer to the documentation on the selenium website.

        Typically, this method is called from the VirtualUser.pre() method.

        Parameters:
        pathToChromeDriver - The full path to the chrome driver server on the injector.
        Throws:
        java.lang.Exception - An error occurred
      • initialisePhantomJSDriver

        void initialisePhantomJSDriver​(java.lang.String pathToPhantomJSExe)
                                throws java.lang.Exception
        Create a new PhantomJSDriver instance for this SeleniumVirtualUser.

        In order to use the PhantomJSDriver, you need to install the PhantomJS on each injector in your test. You must then pass the full path of phantomjs.exe to this method, e.g:

        
         initialisePhantomJSDriver("C:/tools/phantomjs-1.9.7-windows/phantomjs.exe");
         
        For more information on PhantomJS, please refer to the PhantomJS website.

        Typically, this method is called from the VirtualUser.pre() method.

        Parameters:
        pathToPhantomJSExe - The full path of phantomjs.exe
        Throws:
        java.lang.Exception - An error occurred
      • getUnderlyingWebDriver

        WebDriver getUnderlyingWebDriver()
        Get the underlying WebDriver instance for this SeleniumVirtualUser.

        This is useful if you need to call a method that is specific to the WebDriver type that you are using. For example, if you are using the HtmlUnitDriver, you could use this method to call the setJavascriptEnabled method:

        
         HtmlUnitDriver htmlUnitDriver = (HtmlUnitDriver)getUnderlyingWebDriver();
         htmlUnitDriver.setJavascriptEnabled(false);
         
        Returns:
        The underlying WebDriver instance for this SeleniumVirtualUser.