Unable to run parallel appium tests using remote Selenium Grid

Well, honestly, I’m stuck. I spent entire 2 days trying to set up my environment for parallel tests on real android devices using Selenium Grid and Appium servers. Seems like I have everything but nothing works. I’ll try to be quick in my narration. So, I have 2 packages in my Java project; in each package I have 2 different classes (let’s called them GalaxyS5 Smoke Test and GalaxyTab4 Smoke Test) that are using Page Object pattern (means I have a bunch of classes in those packages but they are used as page object classes for those Smoke tests, not tests itself). I’m trying to automate NOT APPLICATION, but just chrome browser (responsive design of my web site) . When I do it regular from one instance of Appium GUI server, everything works excellent. Apppium is launching successfully, test is running smooth and results are being logged correctly. The problem comes when I decided to run those 2 Smoke tests simultaneously on 2 real physical devices. So, my coworker has Selenium Grid console already, so I just registered 2 appium servers on that and console displays them correctly. Below is my GalaxyS5nodeconf.json and GalaxyTab4nodeconf.json files:

{
"capabilities":
** [**
** {**
** “browserName”:“SamsungTab4”,**
** “deviceName”: “d66d8f56”,**
** “version”:“5.1.1”,**
** “maxInstances”: 3,**
** “platformName”:“ANDROID”**
** }**
** ],**
"configuration":
{
** “cleanUpCycle”:2000,**
** “timeout”:30000,**
** “proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,**
** “url”:“http://11.100.33.8:4723/wd/hub”,**
** “host”: “127.0.0.1”,**
** “port”: 4723,**
** “maxSession”: 6,**
** “register”: true,**
** “registerCycle”: 5000,**
** “hubPort”: 4444,**
** “hub”:“http://11.100.33.28:4444/grid/register”,**
** “hubHost”: “11.100.33.28”**
}
}

{
"capabilities":
** [**
** {**
** “browserName”:“SamsungS5”,**
** “deviceName”: “69d39b45”,**
** “version”:“5.1.2”,**
** “maxInstances”: 3,**
** “platformName”:“ANDROID”**
** }**
** ],**
"configuration":
{
** “cleanUpCycle”:2000,**
** “timeout”:30000,**
** “proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,**
** “url”:“http://11.100.33.8:5009/wd/hub”,**
** “host”: “127.0.0.1”,**
** “port”: 5009,**
** “maxSession”: 6,**
** “register”: true,**
** “registerCycle”: 5000,**
** “hubPort”: 4444,**
** “hub”:“http://11.100.33.28:4444/grid/register”,**
** “hubHost”: “11.100.33.28”**
}
}

Keep in mind that both nodes are successfully registered in Selenium Grid and displayed in console so I assume everything was done right.
Next I would like to provide you how my capabilities are set up in the code:

new DesiredCapabilities();
** DesiredCapabilities cap = DesiredCapabilities.android();**
** cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, “Appium”);**
** cap.setCapability(MobileCapabilityType.DEVICE_NAME, “Android Device”);**
** cap.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);**
** cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, “5.1.1”);**
** cap.setCapability(MobileCapabilityType.BROWSER_NAME, “Android”);**
** cap.setCapability(MobileCapabilityType.TAKES_SCREENSHOT, true);**
** cap.setCapability(MobileCapabilityType.DEVICE_READY_TIMEOUT, 60);**
** driver = new AndroidDriver(new URL(“http://11.100.33.8:4723/wd/hub”), cap);**

new DesiredCapabilities();
** DesiredCapabilities cap = DesiredCapabilities.android();**
** cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, “Appium”); **
** cap.setCapability(MobileCapabilityType.DEVICE_NAME, “Android Device”);**
** cap.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);**
** cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, “5.1.2”);**
** cap.setCapability(MobileCapabilityType.BROWSER_NAME, “android”);**
** cap.setCapability(MobileCapabilityType.TAKES_SCREENSHOT, true);**
** cap.setCapability(MobileCapabilityType.DEVICE_READY_TIMEOUT, 60);**
** driver = new AndroidDriver(new URL(“http://11.100.33.8:5009/wd/hub”), cap);**

The last item I want to provide is testng.xml file which I use in order to run parallel tests:

<?xml version="1.0" encoding="UTF-8"?>


** **
** **
** **
** **
** **
** **
** **
** **
** **
** **
** **
** **
** **
** **

Every time I try to run it there is an error occur (**No app set; either start appium with --app or pass in an ‘app’ value in desired capabilities) under “Results of running suite” testng.xml. My question is why do I need to provide an absolute path to some .apk file if I’m not testing an application? I only need to open the chrome browser and run the regular selenium script in there. Any help will be greatly appreciated.

I don’t know why this post didn’t reflect my testng.xml file correctly. Here it is:

?xml version=“1.0” encoding=“UTF-8”?
!DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd
suite name=“Suite” parallel = “tests” thread-count = “2” verbose = “1”
test name = “S5 Test”
parameter name=“port” value=“5009”></parameter
parameter name= “DeviceID” value= “69d39b21”></parameter
classes
class name=“SamsungGalaxyS5.Samsung_Galaxy_S5_Smoke_Test”/
/classes
/test
test name = “Tab4 Test”
parameter name= “port” value= “4723”></parameter
parameter name= “DeviceID” value= “d66d8f10”></parameter
classes>
class name=“SamsungGalaxyTab4.Samsung_Galaxy_Tab4_Smoke_Test”/
/classes
/test> <!-- Test –
/suite> <!-- Suite –

Can you keep browserName empty in your config for node and then try

Tried, didn’t help…

What happens if you change your browserName values to “Chrome”?

@afwang Nothing special, script continue to run only on one device.