Selenium Grid setup across multiple machines

Hi all,

Let this post serve as a form of documentation about how to register an Appium node with a Selenium Grid, in addition to the official documentation available on appium.io. If you want to register an Appium node to a Selenium grid, you must specify the following through fields in the configuration object of your nodeconfig JSON file:

  1. “url” (example: “http://appium.example.com:4755/wd/hub”)
  2. “host” (example “appium.example.com”)
  3. “port” (example: 4755)

More complete nodeconfig file example:

{
    "capabilities": [
        {
            "browserName": "Android",
            "deviceName": "Samsung Galaxy S4",
            "version": "5.0.1",
            "maxInstances": 1,
            "platform": "Android",
        }
    ],
    "configuration": {
        "cleanUpCycle": 2000,
        "timeout": 30000,
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "url": "http://appium.example.com:4723/wd/hub",
        "host": "appium.example.com",
        "port": 4755,
        "maxSession": 1,
        "register": true,
        "registerCycle": 5000,
        "hubPort": 4444,
        "hubHost":"hub.example.com"
    }
}

Now that you know, you can save yourself some trouble since I wasted a couple hours thinking about why Appium was passing the wrong URL to the hub server during registration.

Here’s what happens if ANY of the 3 fields above is missing: Appium (as of version 1.5.1), will ignore all 3 field values and set its own values, as found from the --address and --port options, if specified. If these parameters are not specified, then Appium will use localhost and 4723 as the host and port to register with the Grid. Perhaps there should be a pull request to include a little warning message if a nodeconfig file is missing these 3 values (hint hint, nudge nudge). :stuck_out_tongue: