Selecting a WebDriver Type

By default, Eggplant Performance creates an HtmlUnitDriver instance for each virtual user (VU). If you wish to use a different type of WebDriver then you can do so by calling the initialiseWebDriver() method:

Example

// Create a FirefoxDriver for this virtual user

initialiseWebDriver(WebDriverType.FireFox);

This will discard the current WebDriver instance and replace it with an instance of FirefoxDriver that can be used to drive an instance of the Firefox browser. We recommend that you call initialiseWebDriver() within the pre() method of your custom Selenium VU, so that each VU in your test creates the correct type of WebDriver at the beginning of the test:

Example

public class MySeleniumVU extends com.facilita.fc.selenium.SeleniumVirtualUser

{

// This method will be executed by each VU at the beginning of the test run

@Override

public void pre() throws Exception

{

//do not remove following line

super.pre();

 

// Each VU in the test will use a FirefoxDriver

initialiseWebDriver(WebDriverType.FireFox);

}

}

 

This topic was last updated on January 13, 2022, at 02:42:23 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2022 Eggplant