There is no difference in using emulator the only thing is u need to create an emulator and start it. Once it is started it will be listed in attached devices. All script will then execute in emulator
@amitjaincoer191 Assume that 4 devices is connected to the PC.
When you type the adb devices command it will fetch out all the devices which are connected with the PC.
Among those device how can I pick the exact device to run. Whether this can be done by mentioning the particular device UDID?
Also how to run the same application in multiple devices at a same time.
I mean what kind of settings we need to do in Appium side or in Selenium Grid side.
To run the same app in multiple devices simultaneously you need to run multiple Appium servers. When you launch the server give the UDID and port what Appium listens (this port must be different for each server instance).
From the doc
Support for automating multiple devices simultaneously: Yes, though Appium must be started using different ports for the server parameters --port, --bootstrap-port (or --selendroid-port) and/or --chromedriver-port. See the server args doc for more information
When you have one server running for each device use the ports to run multiple tests simultaneously.
BTW: I haven’t tried Selenium Grid and I use only real devices.
@ashokkumarg I don’t understand what you mean by trigger. Please elaborate a bit more.
When working with multiple host machines it works the same as in single host machine. Launch Appium server for each device and then connect to the Appium server from client with http://<HOST_IP>:<APPIUM_PORT>/wd/hub. When working with single host the HOST_IP address is localhost or 127.0.0.1. In multi-machine setup it is something like 192.168.100.1.
I cannot remember does Appium listen connections from other addresses than localhost by default. If not you can use -a / --address flag to make it listen connections from outside.
As I mentioned I don’t know the abilities of Selenium Grid (there could be even easier solution).
I think you have 2 options
Option 1)
Create a “master” script which can launch your tests in threads or processes. Modify your test to take the URL as commanline parameter. Gather the URL’s in the master script and launch the tests for every URL.
Option 2)
In your test script make a list of drivers and loop this list through for each Appium command.
I prefer option 1. Option 2 does not make sense in most situations.