Methods of the Selenium wrapper

You can just launch your tests with Maven without specifying particular options or you can use the Design option and several dedicated methods on top of the Selenium driver to specify the scenarios you want to update.

Method

Description

Example

NLWebDriver(Selenium webdriver,Name of the NeoLoad User Path, path to the NL project);

NLWebDriver is the constructor of the NeoLoad webdriver.

This constructor allows you to specify the project that is to be updated with the new/updated User Path.

final FirefoxDriver webDriver = new FirefoxDriver(addProxyCapabilitiesIfNecessary(new DesiredCapabilities()));

// projectPath used to open NeoLoad project, null to use the currently opened Project.

final String projectPath = "C:\\Users\\apaul\\projects\\Sample_Project.nlp";

NLWebDriver driver = NLWebDriverFactory.newNLWebDriver(webDriver, "SeleniumUserPath", projectPath);

NLWebDriver(Selenium webdriver,Name of the NeoLoad User Path);

Project path is optional.

If the project is not specified, the wrapper will use the currently opened project.

final FirefoxDriver webDriver = new FirefoxDriver(addProxyCapabilitiesIfNecessary(new DesiredCapabilities()));

 

NLWebDriver driver = NLWebDriverFactory.newNLWebDriver(webDriver, "SeleniumUserPath");

StartTransaction(Name of the current transaction);

This method sends all the Selenium HTTP/HTTPS traffic into a specific NeoLoad container.

This method needs to be used before the Selenium actions related to a business transaction.

public void testGetAlerts() {

driver.startTransaction("home2");

driver.get("http://ushahidi.demo.neotys.com/");

driver.startTransaction("alerts");

driver.findElement(By.partialLinkText("GET ALERTS")).click();

}

StopTransaction()

This method stops the transaction.