Reduce number of tests by single Selenium connection from 100 to 20.

Send quit command to Selenium.
This commit is contained in:
Alexey Andreev 2015-10-20 23:12:13 +03:00
parent 891ec3e6fd
commit e08ed087df

View File

@ -56,15 +56,17 @@ public class SeleniumRunStrategy implements TestRunStrategy {
@Override @Override
public void afterThread() { public void afterThread() {
webDriver.get().close(); webDriver.get().close();
webDriver.get().quit();
webDriver.remove(); webDriver.remove();
} }
@Override @Override
public String runTest(Log log, String runtimeScript, TestCase testCase) throws IOException { public String runTest(Log log, String runtimeScript, TestCase testCase) throws IOException {
commandsSent.set(commandsSent.get() + 1); commandsSent.set(commandsSent.get() + 1);
if (commandsSent.get().equals(100)) { if (commandsSent.get().equals(20)) {
commandsSent.set(0); commandsSent.set(0);
webDriver.get().close(); webDriver.get().close();
webDriver.get().quit();
webDriver.set(new RemoteWebDriver(url, DesiredCapabilities.firefox())); webDriver.set(new RemoteWebDriver(url, DesiredCapabilities.firefox()));
} }