Thanks alot man you saved my day
@Hassan_Radi
Hi @salmanchauhan,
you must use MobileCapabilityType.UDID to select the device, instead of MobileCapabilityType.DEVICE_NAME.
deviceName server capability is only used on iOS simulator as you can see in http://appium.io/slate/en/master/?ruby#appium-server-capabilities64.
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
@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?
@jonahss Will parallel tests be part of 1.5 ? Just asking because your post is from June 2015...Thanks 
@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 !
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:
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?
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?
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 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??
Hi Bhashkar,
Can u please send me the document if any to start Appium Grid with Mac for One Machine with Multiple Devices.
Please do the needful Send me the Document if possible to janardhanreddyqa@gmail.com1
Thanks & Regards,
Janardhan Reddy M.
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
} }