This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
99 / 137
Mar 2016

Hello Pranodyad, would you mind helping me on this? Having hard time with this. I would need All Nitty-gritty from setting up selenium grid/hub to changes in eclipse for supporting parallel devices

My Email Id- shankeytyagi97@gmail.com.

Looking forward for your response.

Hi @Shankeyisgem.

In order to setup Selenium grid for Appium tests you need to have Selenium Hub running and 2 nodes,1 with Android capabilities and another with IOS capabilities registered with the hub.

Now if you are having your testsuite specified in TestNG.xml then you can specify parameter say e.g. "IOSTest" for a test which you want to give to IOS device to run and you can specify parameter e.g."AndroidTest" for a test which you want to give to Android device to run.

These settings "IOSTest" and "AndroidTest" based on which test distribution is going to happen,should be present in BrowserName capability included in .jason file which you may be using to start and register nodes.

And at script side you will be receiving these TestNG parameters and using it to set BrowserName DesiredCapability while instantiating DesiredCapabilities object which you will eventually use to create Driver object.

Note that to distribute tests among the registered nodes,"BrowserName" is the capability which Selenium Grid takes into consideration.

Hope this will help you out.If you want any other details then please feel free to contact me.

Thanks and Regards,
Pranoday

Thanks for your reply Pranodayd,

Couple of things:

  1. I could set up selenium grid by issuing command in cmd but for registering Hubs which port numbers I should provide? Or can we have this Hub/node configuration specified in Eclispe for batter handling?

  2. Actually I have very minimally used Appium with eclipse. So only simple script that I have is just to launch mobile app and some tapping arround and this script is just definded in a class file under eclipse project and when I running it as Tesng, it's going fine for my configured android device and I want to run this script in multiple devices.

Now that said, I have no Idea as how to configure Testing.XML/Json file in eclipse as you mentioned.
Can you send across some working code for same so that it is more clea for me?

Hi @Shankeyisgem

No need to use Eclipse to configure and trigger Selenium Grid execution.You can configure TestNG.xml and .json files using any editor like Notepad etc.

following is and example .json file:
{
"capabilities":
[
{
"browserName": "IpadMiniDevice",
"version":"8.5",
"maxInstances": 1,
"platform":"MAC",
"deviceName":"IpadMiniDevice"
},

        {
	"browserName": "AllIpadDevices",
	"version":"8.5",
	"maxInstances": 1,
	"platform":"MAC",
	"deviceName":"AllTabletDevices"	    
        }
],

"configuration":
{
	"cleanUpCycle":2000,
	"timeout":0,
	"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
	"url":"http://<IpAddress on Which AppiumServer is running:Port on Which AppiumServer is running>/wd/hub",
	"maxSession": 1,
	"port": <Port on Which AppiumServer is running>,
	"host": <IpAddress on Which AppiumServer is running>,
	"register": true,
	"registerCycle": 5000,
	"hubPort": <Port on Which Selenium Grid hub is running>,
	"hubHost": <IpAddress on Which Selenium Grid hub is running>
}

}

You can start Selenium Grid hub and nodes using following dos commands:

To start Hub use following command:
java -jar -timeout 0 -remoteControlPollingIntervalInSeconds 300 -role hub

To start and register node use following command:
java -jar -role node -nodeConfig

Thanks and Regards,
Pranoday

Hi thank you! Could you please share the TestNG file you are using ? I was wondering why you actually start a "normal" node not a Appium node ? Like:

appium --nodeconfig /nodeconfig.json

Do you start Appium separately with specific arguments then ?

17 days later

Hi Bhaskar,

Could you please help me know how you did with single driver instance?? Currently i am able to do that by creating multiple capabilities object and passing them on multiple driver instances. This is not the correct approach i know. Please help me how did you define in your class file and xml. Please.

if possible could you share your code snippet??

29 days later
12 days later

Hi,

can you please suggest us how can we make sure two appium server start for parallel device execution with out using selenium grid
looking for u r reply

Thanks in advance

chari.

20 days later

@bhaskar

my selenium grid is running but when i try to run node server by "node appium --nodeconfig /Users/RajShekhar_DiroLabs/Desktop/node1.json -p 4730 -bp 4730"

its shows me logs like
Appium] Welcome to Appium v1.5.2
[Appium] Non-default server args:
[Appium] port: 4730
[Appium] bootstrapPort: 4730
[Appium] nodeconfig: '/Users/RajShekhar_DiroLabs/Desktop/node1.json'
[Appium] Unable to load node configuration file to register with grid: ENOENT: no such file or directory, open '/Users/RajShekhar_DiroLabs/Desktop/node1.json'
[Appium] Appium REST http interface listener started on 0.0.0.0:4730

but shows Unable to load node configuration file to register with grid: ENOENT: no such file or directory, open '/Users/RajShekhar_DiroLabs/Desktop/node1.json'

Can any one please suggest me how to load node with selenium grid
json file
{
"capabilities":
[ {
"browserName":
"Android", "version":"5.0.1",
"maxInstances": 3,
"platform":"ANDROID",
"deviceName":"FCAZGU007688H3D" } ],
"configuration":
{
"nodeTimeout":120, "port":4730, "hubPort":4444,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4730/wd/hub",
"hub": "127.0.0.1:4444/grid/register",
"hubHost":"127.0.0.1",
"nodePolling":2000,
"registerCycle":10000,
"register":true,
"cleanUpCycle":2000,
"timeout":30000,
"maxSession":1
} }

hello,

During start node server it shows a error "Syntax error in node configuration file: Unexpected token P"

srikantas-Mac-mini-3:bin RajShekhar_DiroLabs$ appium --nodeconfig /Users/RajShekhar_DiroLabs/Desktop/node1.json -p 4730
[Appium] Welcome to Appium v1.5.2
[Appium] Non-default server args:
[Appium] port: 4730
[Appium] nodeconfig: '/Users/RajShekhar_DiroLabs/Desktop/node1.json'
[Appium] Error: Syntax error in node configuration file: Unexpected token P
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at postRequest$ (lib/grid-register.js:42:12)

Can any one please suggest me how to resolve it

I am able to run appium tests on two different devices but they run one after the other. I want them to run on both the devices simultaneously(parallel). I am running appium on two different ports.This is how I am doing it.
appium -p 4725 -bp 4735 -U "706b9496" --chromedriver-port 9518
appium -p 4735 -bp 4745 -U "ZX1B34JFZK" --chromedriver-port 9528

Can anyone help me how to do it?

Hello,

Can any one please help me ,
My nodes are working on hub but when i run my script it shows on hub
13:16:06.657 INFO - Available nodes: [http://0.0.0.0:4725]
13:16:06.657 INFO - Trying to create a new session on node http://0.0.0.0:4725
13:16:06.657 INFO - Trying to create a new session on test slot {maxInstance=1, browserName=Android, version=5.0 .2 , platform=ANDROID}

but in node shows error missing plateformName and shows version name blank i can not recognize that node picking desired capabilities from where
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"browserName":"android","version":"","platform":"ANDROID"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"browserName":"android","version":"","platform":"ANDROID"},null,null,null,null,null,null,null,null,null,null,null,null,null]
[MJSONWP] Encountered internal error running command: Error: You must include a platformName capability
at AppiumDriver.getDriverForCaps (lib/appium.js:40:13)
at AppiumDriver.createSession$ (lib/appium.js:91:28)

12 days later

With 1.5 new features says, you can start multiple sessions in 1 server. Or did i understand badly?

At the moment I'm using 2 emulators in paralel with selenium grid. It works fine but I have to open a new appium server for all emulators I need. So if I want to run with 20 different device emulators, I need to launch 20 appium server, which is not cool. My configuration is like this;

appium -a 172.20.0.196 -p 4723 --session-override --nodeconfig appiumnodeconfig1.json
appium -a 172.20.0.196 -p 4724 --session-override --nodeconfig appiumnodeconfig2.json

appiumnodeconfig1.json:
{
"capabilities": [
{
"browserName": "android",
"version": "5.1",
"platform": "ANDROID",
"maxInstances": 1,
"deviceName": "192.168.56.101:5555"
}
],
"configuration": {
"nodeTimeout" : 120,
"port": 4723,
"hubPort": 4444,
"url": "http://172.20.0.196:4723/wd/hub",
"hub": "172.20.0.196:4444/grid/register",
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"hubHost": "172.20.0.196",
"nodePolling": 2000,
"registerCycle": 10000,
"register": true,
"cleanUpCycle": 2000,
"timeout": 30000,
"maxSession": 1
}
}

appiumnodeconfig2.json:
{
"capabilities": [
{
"browserName": "android",
"version": "5.1",
"platform": "ANDROID",
"maxInstances": 1,
"deviceName": "192.168.56.102:5555"
}
],
"configuration": {
"nodeTimeout" : 120,
"port": 4724,
"hubPort": 4444,
"url": "http://172.20.0.196:4724/wd/hub",
"hub": "172.20.0.196:4444/grid/register",
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"hubHost": "172.20.0.196",
"nodePolling": 2000,
"registerCycle": 10000,
"register": true,
"cleanUpCycle": 2000,
"timeout": 30000,
"maxSession": 1
}
}

The thing is, I want to start only 1 appium server and connect multiple emulators to it. Can I do it and how?
Thanks in advance

Thank you but it doesn't answer my question. Tutorials on the website shows exactly the same configuration with mine. You have to open a server for every node.

But I already got the answer from Jonathan Lipps yesterday. He told me that 1.5 work was the groundwork for that new feature, but the feature itself is not released. I guess we're going to have to wait unfortunately.