Appium prallel device execution in multiple machines

Have you tried to start the remote using the hub’s http://address:port/wd/hub (probably http://localhost:4444/wd/hub)? If you’re only getting one running locally, it’s because of the first line. You’ll want to register the remote machine with the hub as an available node and then the hub will send out the tests to it. I’ve successfully gotten this to work this way.

The Grid docs helped me out a lot when trying to initially set things up: GitHub - SeleniumHQ/selenium-google-code-issue-archive: Archive, please see main selenium repo

Thanks Christianklempwf,
Is there any possibility to run more than one emulator(parallely) in a machine using appium +selenium ?
If it possible , Then how ?
Kindly help me

It may be possible for Android, but not iOS. Only one iOS simulator can be running at any time. Doing so with Android and Genymotion may be possible, but I highly suspect it wouldn’t perform well.

Have you looked into the Sauce Labs remote solution? That may be your best bet, as you can run them in parallel on what ever device you specify. Check it out at https://saucelabs.com/

Hi All,

I also trying to execute appium script on multiple devices using selenium grid.

1 Like

possible in real device.

1 Like

@serdaraytac
Why I cannot get it work like yours
What are you doing differently that many of us cannot get it work? I have work on it for days and I still do cannot get to work any advice will be greatly appreciated.
My issue

Hi @serdaraytac can you plz guide me how you have successfully tested in ios device, as i am trying to connect 2 ios devices and failed to do so in mac. Any help will be much appreciated.

As far as i know…, In the above video, he was tested three devices,1-IOS, 2-Android devices were presented. So, in Mac only one iphone can be tested and remaining Android’s can also be tested along with parallel…!!!
Am i correct?

@serdaraytac
from what i’m seeing, however you were able to run tests on multiple devices, it is not happening in parallel, is it?

Hi,

Please share the steps, How did you set up all the things, Since I am new to appium.

Thanks in advance!
Astha

Messaging Applications Test

1 Like

You should start an appium per real device. Appium nodes should register to your selenium grid.
Android apps can be controlled by starting activity but for iphone you must sign app or ipa with your apple developer certificate.
And it should be generated for debug on real device.

And also you can start multiple appiums on a pc no need to use virtualization.
Connect all real devices to your mac android or iphone it does not matter.

You should start appium nodes with different ports.
Android: start with different bootstrap port
IOS : start with different --tmp folder parameter

Dont use virtualbox for multiple iphones because it causes log capture deviceconsole error. Virtualbox has some usb issues. You can test multiple iphone devices on the same MAC by giving --tmp parameter.

1 Like

Hi @suayipozmen, please share the steps.

@pr4bh4sh it is just simple as you will add only tmp parameter your appium command.

appium -p 6000 --nodeconfig /Users/testinium/iphone6.json -U SDFD43523SDF --tmp /tmp/iphone6
appium -p 7000 --nodeconfig /Users/testinium/iphone5c.json -U RG435G4J6535 --tmp /tmp/iphone5c

2 Likes

You sure about this? For me the test runs are not parallel but concurrent.

All devices are connected to same machine and junit tests are started at the same time.
What do you mean by concurrent?

Sorry I meant to say sequential. I’m using parametrized junit runner (separate thread for each device), and it works perfectly for android but not ios (using your example).
Whats happening is that while tests are started at the same time, its only one test actually running at the time - the other threads are paused.

Hi All,

I am trying to run parallel test on different OS by connecting to selenium Hub.
Here is my scenario:

Hub: On Windows machine
Node1: On same window machine as HUB
Node2: On Mac Machine.

I am trying to run on Android devices connected to both the OS.
I am able to run on Windows but on MAC appium is throwing an error "Unable to load node configuration file to register with grid"

Here is my both Node files:

Node1: {
“capabilities”:
[
{
“browserName”: “Android”,
“version”:“5.1.1”,
“udid”:“052d6d76002e47df”,
“maxInstances”: 1,
“platform”:“ANDROID”,
“deviceName”:“google Nexus 5”
}],
“configuration”:

{
“nodeTimeout”:120,
“port”:4740,
“hubPort”:4444,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://127.0.0.1:4740/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

Node2: {
“capabilities”:
[
{
“browserName”: “Android”,
“version”:“4.3”,
“udid”:“4df742b317683077”,
“maxInstances”: 1,
“platform”:“ANDROID”,
“deviceName”:“samsung GT-N7100”
}],
“configuration”:

{
“nodeTimeout”:120,
“port”:4728,
“hubPort”:4444,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://127.0.0.1:4728/wd/hub”,
“hub”: “10.123.23.123:4444/grid/register”,
“hubHost”:“10.123.23.123”,
“nodePolling”:2000,
“registerCycle”:10000,
“register”:true,
“cleanUpCycle”:2000,
“timeout”:30000,
“maxSession”:1
}
}

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")