I'm running 2 firefox windows tests, 2 firefox mac tests, 2 chrome windows tests, and 2 chrome mac tests in parallel on both a windows node and a mac node. All tests passes except the 2 firefox mac tests. Sometimes 2 firefox mac tests will pass, but the 2 firefox windows tests would fail. Never will both 2 firefox mac tests and 2 firefox windows tests will pass at the same time. I am using the latest firefox driver, latest firefox browser version, latest selenium webdriver, and latest java 8 jdk.
testbase file
if(browser.contains("winfirefox"))
{
System.setProperty("webdriver.gecko.driver", ReadProperties.globalProp.getProperty("pcgeckodriver"));
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setCapability("platform", "WINDOWS");
firefoxOptions.setCapability("browser", "firefox");
firefoxOptions.setCapability("newCommandTimeout", 5000);
firefoxOptions.setCapability(FirefoxDriver.MARIONETTE, true);
whichNodeURL=winNodeURL;
try
{
driverThread.set(new RemoteWebDriver(new URL(whichNodeURL), firefoxOptions));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
else if(browser.contains("macfirefox"))
{
System.setProperty("webdriver.gecko.driver", ReadProperties.globalProp.getProperty("macgeckodriver"));
FirefoxOptions macfirefoxOptions = new FirefoxOptions();
macfirefoxOptions.setCapability("platform", "MAC");
macfirefoxOptions.setCapability("browser", "firefox");
macfirefoxOptions.setCapability("newCommandTimeout", 5000);
macfirefoxOptions.setCapability(FirefoxDriver.MARIONETTE, true);
whichNodeURL=macNodeURL;
try
{
driverThread.set(new RemoteWebDriver(new URL(whichNodeURL), macfirefoxOptions));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
String weburl = ReadProperties.globalProp.getProperty("weburl");
this.driverThread.get().get(weburl);
this.driverThread.get().manage().window().maximize();
mac node json file
{
"capabilities":
[
{
"browserName": "firefox",
"marionette": true,
"maxInstances": 2,
"browser-version": "66.0.3",
"platform": "MAC",
"seleniumProtocol": "WebDriver"
},
{
"browserName": "chrome",
"maxInstances": 2,
"browser-version": "73.0.3683",
"platform": "MAC",
"seleniumProtocol": "WebDriver"
},
{
"browserName": "safari",
"technologyPreview": false,
"platform": "MAC",
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 2,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hub": "http://xxxxxxx:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"role": "node",
"cleanUpCycle": 5000,
"timeout": 5000,
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 2,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
TESTNG FILE
<suite name="XOME Suite" parallel="tests" verbose="1" thread-count="2">
<test name = "Mac Firefox Tests" preserve-order="true" group-by-instances="true">
<parameter name="browser" value="macfirefox">
<classes>
<class name="webTests.FilterMoreResultsByKeyword" />
<class name="webTests.FilterMoreResultsByYear" />
</classes>
</parameter>
</test>
<test name = "Win Firefox Tests" preserve-order="true" group-by-instances="true">
<parameter name="browser" value="winfirefox">
<classes>
<class name="webTests.FilterMoreResultsByKeyword" />
<class name="webTests.FilterMoreResultsByYear" />
</classes>
</parameter>
</test>