1

Is there any way to run parallel test in appium just like selenium grid? How can we set different nodes in appium?

RISHI KHANNA
  • 354
  • 5
  • 23

6 Answers6

2

The problem is that appium is using the iosSimulator or a Genymotion VM exclusively, and isn't really designed to run parallel on one machine like that. You can, however, set up multiple VMs with their own instances of appium running (I feel like this would be slow, but is theoretically an option), or use BrowserStack, Sauce Labs, or something similar in order to run multiple tests at once.

Dabel
  • 41
  • 8
  • I am using Appium with Genymotion and run two emulators in parallel. It is very easy set up and also running multiple VM's should not affect appium functionality, might slow down the system. Also sauce labs and browser stack is really very slow compared to Genymotion. – Vinay Apr 27 '16 at 07:48
2

Yes, we can achieve parallel execution as like Selenium using GRID concept.

u need to start node by placing following content in ur json file

    { "capabilities": 
    [ 
    { "browserName": "<e.g._iPhone5_or_iPad4>",
     "version":"<version_of_iOS_e.g._7.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>"
     } }

look in this post http://qaautomationworld.blogspot.in/2014/11/appium-remote-execution-grid-execution.html

Sravan
  • 591
  • 1
  • 4
  • 16
1

This can we do using TestNg also can be implemented using Multithreading.

IN selenium Grid need to run one Hub and different-node but in this case you run multiple Appium server in different-2 port

Sadik Ali
  • 1,129
  • 10
  • 26
  • This is the approach that I use on my last company... using several Appium server run on different port and combining it with SeleniumGrid. Its possible on Android (with Linux or Unix like machine where the appium servers run). But still cannot do it with iOS, since iOS is using only one instance Instrument when running automation test with real device or simulator. – Hayi Nukman Dec 23 '15 at 06:06
1

Following command can be used to start multiple Appium servers

appium -p 10000 # server 1
appium -p 10001 # server 2
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
0

you can refer this parallel test with appium & selenium grid

As for to run Appium in Grid follow the steps

Step1: add the Appium in Environment Vairable 
Step2: Run the Grid for Hub  
Step3: Run the Appium through command prompt using the selective commands 
Step4: Run you java code through Maven command 'mvn'
Community
  • 1
  • 1
selva
  • 1,175
  • 1
  • 19
  • 39
0

To achieve parallel Testing through Appium, I have used Selenium Grid and TestNG along with Appium.

Steps:

  1. Start Selenium Server. (This will be the Hub for Selenium Grid)
  2. Start Appium Server on default Port (This will be the Hub for appium Grid Configuration)
  3. Now on different ports, initialise the nodes (Node1, Node2) with the matching capabilities as defined in TestNG.xml/Properties file. (Both the node configurations must be defined in seperate json.cfg file)
  4. Add a parameter in testNG.xml as parallel="tests".

Ensure that the device/emulators with matching capabilities is connected.