Appium prallel device execution in multiple machines

Could some please add a proper tutorial for connecting an appium hub to a selenium grid to the appium docs. Hunting around Stackoverflow for hints of how to get it working is not optimal.

Heres how I got my set up working.

{
  "capabilities":
  [
    {
      "browserName": "iPhone 4s"
    , "platform": "MAC"
    , "version": "7.1"
    ,  "maxInstances": 1
    }
  ],
  "configuration":
  {
    "cleanUpCycle":2000,
    "timeout":30000,
    "hub": "http://<selenium_hub:ip_or_hostname>:<selenium_hub:port>/grid/register",
    "url": "http://<appium_hub:ip_or_hostname>:<appium_hub:port>/wd/hub",
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "host": "<appium_hub:ip_or_hostname>",
    "port": <appium_hub:port>,
    "maxSession": 1,
    "register": true,
    "registerCycle": 5000,
    "hubPort": <selenium_hub:port>,
    "hubHost": "<selenium_hub:ip_or_hostname>"
    }
}

note the use of hub and url to bind the appium hub and the selenium hub to one another

start the service

appium --nodeconfig ~/appium/nodeconfig.json --tmp /tmp/iphone4s -p 4725

the ruby script

require 'selenium-webdriver'

selenium_hub_url = 'http://<selenium_hub:ip_or_hostname>:<selenium_hub:port>'

caps = Selenium::WebDriver::Remote::Capabilities.iphone
caps.browser_name = "iPhone 4s"
caps[:device] = 'iPhone 4s'
caps[:app] = 'safari'
caps[:deviceName] = 'iPhone 4s'
caps[:platformName] = 'iOS'
caps[:platformVersion] = '7.1'
caps[:browserName] = "iPhone 4s"

driver = Selenium::WebDriver.for(:remote, desired_capabilities: caps, url: selenium_hub_url)
driver.navigate.to("http://www.google.com")

Hi Suayipozmen,

The parallel execution is working without any issues for native application.

But my application is combination of both native and hybrid. To access the hybrid pages we have to use the ios_webkit_debug_proxy with 27753 port number, to run the test parallely I tried to started the ios_webkit_debug_proxy with different port number it’s not working.

The reason is not able to override the default port number.

Kindly help me to overcome the issue.

@chelladurai
Happy to hear you have successfully run multiple tests in a mac.

I haven’t tried browser testing on multiple ios devices. But i have read some issues on github it is not as simple as native application because of ios_webkit_debug_proxy port problem.

See this comment it may help you.

@suayipozmen

Thanks for sharing that link.

It resolves my issue. Now am able to execute the test parallely for ios Hybrid application’s also.

Guys,

Check this out. we have shared a framework in https://github.com/appium/appium/issues/273#issuecomment-162822796 that supports parallel execution on iOS and android using TestNG and no selenium grid concepts.

Framework URL: https://github.com/saikrishna321/AppiumTestDistribution

Let me or @saikrishna321know if you face any issues.

1 Like

@suayipozmen Nice Post. Please help me in the below scenario.

i am able to start appium with different nodes on my MAC machine.

Problem is, i am not able to point to the remote server and run my tests from eclipse.

Please help me how to run my appium tests against the remote server.

thanks,
Gopi

Hello,

Can any one please help me ,
My nodes are working on hub but when i run my script it shows on hub
13:16:06.657 INFO - Available nodes: [http://0.0.0.0:4725]
13:16:06.657 INFO - Trying to create a new session on node http://0.0.0.0:4725
13:16:06.657 INFO - Trying to create a new session on test slot {maxInstance=1, browserName=Android, version=5.0 .2 , platform=ANDROID}

but in node shows error missing plateformName and shows version name blank i can not recognize that node picking desired capabilities from where
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“android”,“version”:"",“platform”:“ANDROID”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“browserName”:“android”,“version”:"",“platform”:“ANDROID”},null,null,null,null,null,null,null,null,null,null,null,null,null]
[MJSONWP] Encountered internal error running command: Error: You must include a platformName capability
at AppiumDriver.getDriverForCaps (lib/appium.js:40:13)
at AppiumDriver.createSession$ (lib/appium.js:91:28)

Hi @Srikanth_Katakam: Did you get the solution for the issue? I am facing exactly same issue

http://techqarifad.blogspot.com/ follow the steps