Appium 2.0 has finally been released! HeadSpin has been a proud supporter of Appium, and we are so excited to show you how to install the latest version of Appium and start using it in your existing scripts.
In order to get started on Appium 2.0 on HeadSpin, please reach out to helpdesk@headspin.io, and we will install Appium 2.0 on each of your devices.
For local testing, we will need to do a new install.
Installing Appium 2.0
Appium 2.0 is now the default that can be installed through NPM:
npm i --g appium
This will install Appium globally so it can be run from anywhere in your command line . You can start the Appium server with the following command:
appium
You should see some output that starts with a line like this:
rohan@Rohans-MacBook-Pro-14 appium_2 % appium
[Appium] Welcome to Appium v2.0.1 (REV 0ccd099bff8e384043883c4ae01b589794b13d72)
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLS in your client code to connect to this server:
[Appium] http://127.0.0.1:4723/ (only accessible from the same host)
[Appium] http://192.168.0.62:4723/
[Appium] No drivers have been installed in /Users/rohan/.appium. Use the "appium driver" command to install the one(s) you want to use.
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
Install Appium 2.0 Drivers
As can be seen, the Appium server is up and running. Appium 2.0 has a major architectural change where it uses drivers to interact with a range of devices and browsers. In addition, there are plugins to enable more advanced features.
This greatly simplifies the complexity of Appium and allows the community to contribute easily.
Let’s go ahead and install the Android UIAutomator2 and iOS XCUITest drivers
Or even used in the browser version at https://inspector.appiumpro.com. In order to use this on a local Appium server, please start the server with the --allow-cors flag.
Lastly you can use HeadSpin’s integrated inspector.
Using Appium 2.0 on HeadSpin
Since HeadSpin manages the Appium server and driver installations for you, the migration to Appium 2.0 is seamless. However, there are still a few updates you’ll want to make to your capabilities, to ensure a smooth transition.
First we can check which versions of Appium are available on each server with the following command:
curl -X GET https://{ headspin-host }:{ headspin-port }/v0/{your-api-token}/wd/hub/versions
This data can be obtained from the UI as follows:
Click on the three dots next to the device under test and click ‘Automation Configuration’
Then take the Web Driver URL append /versions to the end. Eg:
(If your host doesn’t have any Appium 2 servers or plugins available, or if you need a specific version, get in touch with your HeadSpin support contact or helpdesk@headspin.io, and we’ll get things sorted out for you.)
To use the desired version of Appium with plugins, please add the following capability to your Appium script: