Unable to Connect Android Device to Grid

When i’m trying to connect android to Grid,it is showing the following error…
I’m using following configurations…
Android Device with 4.4.2
Windows 7

nodeconfig.json

{
“capabilities”:
[
{
“browserName”: “<e.g._iPhone5_or_iPad4>”,
“version”:"<version_of_iOS_e.g._6.1>",
“maxInstances”: 1,
“platform”:"<platform_e.g._MAC_or_ANDROID>"
}
],
“configuration”:
{
“cleanUpCycle”:2000,
“timeout”:30000,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://<host_name_appium_server_or_ip-address_appium_server>:<appium_port>/wd/hub”,
“host”: <host_name_appium_server_or_ip-address_appium_server>,
“port”: <appium_port>,
“maxSession”: 1,
“register”: true,
“registerCycle”: 5000,
“hubPort”: <grid_port>,
“hubHost”: “<Grid_host_name_or_grid_ip-address>”
}
}

Can any body suggest me how to resolve this.Thanks in advance !!!

When i’m trying to connect android to Grid,it is showing the following error…
I’m using following configurations…
Android Device with 4.4.2
Windows 7

{
“capabilities”:
[
{
“browserName”: “LG Nexus 5”,
“version”:“4.4.2”,
“maxInstances”: 1,
“platform”:"_ANDROID"
}
],
“configuration”:
{
“cleanUpCycle”:2000,
“timeout”:30000,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://xxxxxxx:4723/wd/hub”,
“host”:xxxxxxx,
“port”: 4723,
“maxSession”: 1,
“register”: true,
“registerCycle”: 5000,
“hubPort”: 4444,
“hubHost”: “xxxxxx”
}
}
Can any body suggest me how to resolve this.Thanks in advance !!!

What is the -V argument? I believe you should enter:
node . --nodeconfig C:\path\to\your\nodecnf.json

your .json file: “host”:“xxx.xxx.xxx.xxx”,

https://www.jsoneditoronline.org/

I have done as u told Mr. @gualber98. but it is again showing the error…

Thanks for your reply and in advance too…

I couldn’t know why this error always coming…

module.js :340

@bhaskar :-

  1. First you need to start selenium hub check selenium hub documentation ( “hubPort”: 4444, “hubHost”:“localhost”)
  2. Then register node to selenium hub using the command

sample json

{
“capabilities”:
[
{
“browserName”: “note3”,
“device”: “Appium”,
“version”:"",
“maxInstances”: 1,
“platform”:“ANDROID”
}
],
“configuration”:
{
“cleanUpCycle”:2000,
“timeout”:10000,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://localhost:4568/wd/hub”,
“maxSession”: 1,
“port”: 4568,
“host”: “localhost”,
“register”: true,
“registerCycle”: 5000,
“hubPort”: 4040,
“hubHost”: “localhost”
}
}

Just try this

  1. Open cmd
  2. cd D:
  3. cd D:\appiumSample
  4. then run your command

I have done the same as u said…but again it shows the same error…

@Appium_Master , please suggest me to get out of this error…Thank you in advance.!!!

Hi @bhaskar ,
‘Cannot find module’ is a node error, not an appium or grid related error.
If you are using AppiumForWindows, you must execute “node node_modules/appium” from AppiumForWindows folder instead of “node .”.

Thanks alot @rgonalo . its working fine a bit…but showing error…

My Json file looks like this… Are there any changes required? Please let me know if any…

{
“capabilities”:
[
{
“browserName”: “ANDROID”,
“device”: “LG Nexus5”,
“version”:“4.4.2”,
“maxInstances”: 1,
“platform”:“ANDROID”
}
],
“configuration”:
{
“cleanUpCycle”:2000,
“timeout”:10000,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://localhost:4723/wd/hub”,
“maxSession”: 1,
“port”: 4723,
“host”: “localhost”,
“register”: true,
“registerCycle”: 5000,
“hubPort”: 4444,
“hubHost”: “localhost”
}
}

@bhaskar
Note :- Don’t edit the json file which I’m attaching. I changed as per your requirement.
Rename the extension from .txt. to .json and copy to “D:\appiumSample” location
nodeconfig_new.txt (580 Bytes)

open cmd
java -jar selenium-server-standalone-2.44.0.jar -role hub

open new cmd
Navigate to your appium location
AppiumForWindows-1.3.4.1\Appium\node_modules\appium\bin
run below command
node appium.js -a localhost -p 4567 --nodeconfig “D:\appiumSample\nodeconfig_new.json”

I hope this will work, I tried on my laptop and it is working for me.

Thanks
Srikanth

Thanks for your guidance . !!!

1 Like

I did the same @Appium_Master…as it is above again it shows the error…

Could you please suggest me in a positive way.

Could it be possible to connect Android device to Grid connecting as a node with out node json file?

Hi all,

I’m getting below error while connecting to Grid using Appium , the second device getting error and one device is executing fine.

error: Unhandled error: Error: read ECONNRESET
at errnoException (net.js:905:11)
at TCP.onread (net.js:559:19) context: [POST /wd/hub/session {"desiredCapabilities…

Error Coming while running multiple sessions using appium. Please let me know if any one knows about this.

I’m using different appium port numbers 4723, 4724 for two devices…

Thanks,
Bhaskar.