I'm trying to run parallel test on 2 devices using appium & selenium grid but for some reason it runs only on the first node server (and first device) but nothing happen on the second server.
Also if I'm shutting down the first server and run the test then the test run on the second server so there shouldn't be any issue with the servers.
Is there some parameter that I have to give in order to set it to parallel ?
Thanks for the help !
Here are my files :
First server json file :
{
"capabilities":
[
{
"browserName": "SamsungS6",
"deviceName": "04157df40862d02f",
"version":"6.0.1",
"maxInstances": 3,
"platform":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://localhost:4491/wd/hub",
"host": "localhost",
"port": 4491,
"maxSession": 5,
"register": true,
"registerCycle": 5000,
"hubPort": 4433,
"hubHost": "localhost"
}
}
Second server json file :
{
"capabilities":
[
{
"browserName": "OnePlusOne",
"deviceName": "14b2b276",
"version":"6.0.1",
"maxInstances": 3,
"platform":"ANDROID",
"platformName":"ANDROID"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://localhost:4490/wd/hub",
"host": "localhost",
"port": 4490,
"maxSession": 5,
"register": true,
"registerCycle": 5000,
"hubPort": 4433,
"hubHost": "localhost"
}
}
Run the selenium grid :
java -jar selenium-server.jar -role hub -port 4433
Run first scenario
node.exe node_modules\appium\bin\appium.js --nodeconfig myfirstscenario.json -p 4490 -U 14b2b276 -bp 5490 --chromedriver-port 6490
Run second scenario
node.exe node_modules\appium\bin\appium.js --nodeconfig mysecondscenario.json -p 4491 -U 04157df40862d02f -bp 5491 --chromedriver-port 6491
The test
@BeforeTest(alwaysRun = true)
public void setUp(){
try {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "ANDROID");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "");
capabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, appPackage);
capabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, appActivity);
driver = new AndroidDriver(new URL("http://localhost:4433/wd/hub"), capabilities);
new WebDriverWait(driver, 60);
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
@Test
public void test(){
System.out.println("hello world");
try {
sleep(6000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@AfterTest(alwaysRun = true)
public void closeDriver(){
driver.quit();
}