Selenium Grid Appium configuration Example

Selenium Grid Appium configuration Example,Connecting appium server to selenium grid for android Testing,Learn APPIUM for android Testing,while working with Appium for android testing using Selenium Grid  we'll face one issue like how to connect to appium server to selenium grid why because Selenium Grid is creating nodes in different machines to run Selenium Scripts in multiple operating systems.

Selenium Grid Appium configuration Example Steps:

Please follow below simple steps to resolve the problem while working with Selenium Grid+Appium.I have configured appium with selenium grid in my test environment using below simple tests.

1.Open Appium
2.Go to General Settings.
3.Enter Server Ip and port.
4.You'll see option like "Selenium Grid Configuration File",just select the check box.


Selenium Grid Appium configuration Example
Selenium Grid Appium configuration Example
Your Configuration file will looks like below and save it in json xml format

In the node config file you've to mentin the browserName, version and platform details and based on these parameters the grid will re-direct tests to the proper device. You've to configure host details and the selenium grid details. For a full list of all parameters and descriptions below chec below file,Once you starts the Appium server and it'll register with the grid, you will see your device on the grid console page:



{
  "capabilities":
      [
        {

          "browserName": "<e.g._device Name",
          "version":"<version_of_Android/IOS_e.g._6.0>",
          "maxInstances": 1,
          "platform":"<platform_e.g.ANDROID>"
        }

      ],

  "configuration":

  {

    "cleanUpCycle":3000,
    "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 hostname(or) grid ipaddress>"
  }

}

1.Create Nodes in required Machines
2.Need to Start new Nodes for each device as you've configured in different machines. 3.Register those nodes with Selenium Grid Server.
4.Now Start the Server using java -jar selenium-server-standalone-2.43.0.jar -role hub
5.You can register the nodes with this command  - appium -p -U --nodecofig 

  Simple nodeConfig json File


  {
  "capabilities":

      [

        {

          "browserName": "device Name",
          "version":"6.0",
          "maxInstances": 1,
          "platform":"ANDROID"

        }

      ],

  "configuration":
  {

    "cleanUpCycle":3000,
    "timeout":30000,
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "url":"http://127.0.0.1:4723/wd/hub",
    "host": 127.0.0.1,
    "port": 4723,
    "maxSession": 1,
    "register": true,
    "registerCycle": 5000,
    "hubPort": 4789,
    "hubHost": "10.98.45.789"
  }

}


I think you'got enough information on How to Connect appium server to selenium grid topic,in case you'lie my post,please provide your valuable comment and share with your friends.Than you for reading my blog posts.

No comments:

Post a Comment