Appium team has migrated the appium server to 2.x (currently in beta) which involves lot’s of changes in terms of usage but not impacting any of the automation behaviour.
Highlights of appium changes –
- Decoupled individual appium drivers
- Introducing appium plugin
- Support w3c protocol standard
- Changes to appium capabilities
- Appium inspector separated from appium desktop
- Deprecated some of the appium commands as part of w3c migration
- Appium JavaScript client library is deprecated and will have to use webdriverIO instead.
- Changes to appium client libraries e.g java-client deprecated lot’s of commands
Install the latest appium server
you can use below npm command (there is no GUI as we have for 1.x)
sudo npm install -g appium@next
if prompted, provide system password and enter to continue
Note – minimum node.js version >= 12
More info on appium driver install and uninstall
Run appium server
run below command in terminal / command prompt
appium
We can use appium cli arguments as listed appium cli args
To verify appium version –
appium -v
Verify if appium server running –
navigate to browser and run below url, you should see the appium version
http://0.0.0.0:4723/status
Individual appium driver installation –
Appium decoupled all the drivers and have to install them individually on a need basis.
Example –
Run below command for IOS driver i.e – xcuitest
appium driver install xcuitest
For android i.e – uiautomator2
appium driver install uiautomator2
Verify the installations –
You can install appium-doctor npm package to verify the installations
npm install -g appium-doctor
appium-doctor --version
Then individually for all appium drivers, we can verify the setup is correct to run tests on Android or IOS devices.
appium-doctor —-android
appium-doctor —-ios
Updating the appium drivers –
To list down all the appium drivers installed on machine –
appium driver list
To verify if any updates available
appium driver list --updates
To update individual appium drivers or multiple drivers at a time –
appium driver update xcuitest
or
appium driver update xcuitest, uiautomator2 …
Note – All the drivers are installed under home/.appium
Introduced appium plugin
Appium allows to write code projects that allow for overriding, altering, extending, or adding behaviours to Appium, that can be easily created and shared.
You can install the plugins individually in your project and use the feature / methods
appium plugin install [pluginName]
you can also use the plugins along with appium command while running the server as –
appium --use-plugins=[appiumPlugin]
Support w3c protocol standard
As per the appium documentation on migrating completely to w3c protocol –
“Up until Appium 2.0, Appium supported both protocols, so that older Selenium/Appium clients could still communicate with newer Appium servers. Moving forward, support for older protocols will be removed.”
There are lot’s of changes introduced to support the w3c as a whole.
Appium DesiredCapabilities are now renamed as appium capabilities –
- All capabilities should be prefixed with
appium:
keyword, use this in appium inspector or in java code to launch simulators / real devices.
example – appium:app
, appium:noReset
etc
- Introduced appium:options section to capture multiple appium capabilities –
example –
//You can use this in webdriverIO wdio.conf.ts file { "platformName": "iOS", "browserName": "Safari", "appium:options": { "platformVersion": "14.4", "deviceName": "iPhone 11", "automationName": "XCUITest" } }
Note – for list of capabilities, refer capabilities guide
- The appium JavaScript library is deprecated, and instead we should be using webDriverIO
- Appium java-client library is updated to 8.x to support w3c standard protocol
- Appium inspector as a separate utility
Appium still supports all the existing cli arguments as listed below –
http://appium.io/docs/en/writing-running-appium/server-args/index.html#server-flags
New argument to install the drivers in a specified path –appium -ah /path/to/custom/appium/home driver install [driverName]
Reference –
https://github.com/appium/appium/blob/master/packages/appium/docs/en/guides/migrating-1-to-2.md
2 Comments