This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
92 / 137
Feb 2016
1 month later

Hello Everyone,

i have a issue registering node using appium

my json file is

{
"capabilities":[
{
"deviceName":"a01b27a8",
"version":"5.1.1",
"maxInstances":5,
"platform":"ANDROID"
}
],
"Configuration":{
"cleanUpCycle":2000,
"timeout":30000,
"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://127.0.0.1:4723/wd/hub",
"hub":"http://192.168.1.202:4444/grid/register/",
"maxSession":1,
"Port":4723,
"host":"127.0.0.1",
"register":true,
"registerCycle":5000,
"hubHost":"192.168.1.202",
"hubport":"4444"
}
}

and the log what i got is

error: uncaughtException: Cannot read property 'url' of undefined date=Mon Dec 28 2015 16:33:22 GMT+0530 (India Standard Time), pid=2936, uid=null, gid=null, cwd=C:\Program Files\Appium\node_modules\appium, execPath=C:\Program Files\Appium\node.exe, version=v0.10.26, argv=[C:\Program Files\Appium\node.exe, C:\Program Files\Appium\node_modules\appium\lib\server\main.js, --address, 127.0.0.1, --port, 4725, --intent-category, android.intent.category.LAUNCHER, --nodeconfig, C:\Users\FC\workspace\XXXXXXt\Json\SamsungS4.json, --platform-name, Android, --platform-version, 22, --automation-name, Appium, --log-no-color], rss=71778304, heapTotal=61430984, heapUsed=42524552, loadavg=[0, 0, 0], uptime=17153.8082866, trace=[column=32, file=Files\Appium\node_modules\appium\lib\server\grid-register.js, function=postRequest (C:\Program, line=46, method=null, native=false, column=7, file=Files\Appium\node_modules\appium\lib\server\grid-register.js, function=C:\Program, line=14, method=null, native=false, column=14, file=fs.js, function=null, line=266, method=null, native=false, column=15, file=fs.js, function=Object.oncomplete, line=107, method=oncomplete, native=false], stack=[TypeError: Cannot read property 'url' of undefined, at postRequest (C:\Program Files\Appium\node_modules\appium\lib\server\grid-register.js:46:32), at C:\Program Files\Appium\node_modules\appium\lib\server\grid-register.js:14:7, at fs.js:266:14, at Object.oncomplete (fs.js:107:15)]

and to register node i used

appium -a 127.0.0.1 -p 4723 --bootstrap-port 4727 -U a01b27a8 --nodeconfig c:\Users\FC\workspace\XXXXXXt\Json\SamsungS4.json

Please help

Thank you
Ravi

1 month later

@bhaskar
when I run my test I always see in my grid/consols that I have 1 Instance less (like not available).
How to manage it so after executing a test the Instance went back to be available, please?

It won't be in 1.5, but appium 1.5 includes a lot of code that makes parallel sessions possible.

So expect it to come as a major feature after 1.5.

@jonahss I see. Until then, what do you think is the best way to run tests in parallel on iOS devices ? This Instruments limitation of 1 device per machine is still a thing, right ? So VM's would be a legit approach still ? Thanks !

15 days later

Hello guys.
I can help you out in setting up Selenium Grid for Appium tests.
We have a Grid setup where Android and IOS tests run parallel.
Please feel free to contact me.

Thanks and Regards,
Pranoday

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
} }