Running test on the Genymotion emulator

When you are running a single Genymotion emulator on your machine, you can pass the platform version to the desired capabilities and it will take care. The code for that is as given; customize it for the platform version you have created the emulator for:

capabilities.setCapability("platformVersion", "5.1");

When we are running multiple versions of Genymotion emulator, we need to pass the udid of the targeted device where we want to run the automation:

Here's the code snippet for passing the udid as the desired capabilities:

capabilities.setCapability("udid", "192.168.56.102:5555");

With the Genymotion emulator, one of the exceptions is that the desired capability to launch the emulator doesn't work the way it works seamlessly in Android Virtual Devices. Also, we need to launch Genymotion emulators before we trigger the test. Here, how we can launch the Genymotion emulator via the command line is explained.

Use these steps to start the Genymotion emulator via the command line on macOS:

  1. Launch the Terminal.
  2. Type in the VBoxManage list vms command. This is the sample output:
  1. Type in the following command (modify the vm name with the data on your system):
      open -a /Applications/Genymotion.app/Contents/MacOS/player.app --
args --vm-name '1010b597-fb0b-4ef7-9f59-57070b3108a7'
  1. The last parameter passed is vm id, as shown in the .

This will launch the Genymotion emulator without launching the Genymotion app. Let's take a look at how to run the same test for physical devices.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.138.178