If you & # x27; ve been around the Appium domain for a while, you & # x27; ve probably heard that Appium 2.0 has been & quot; coming shortly & quot; for a rattling long time! I & # x27; m glad to report that work on it has be progress well, and Appium 2.0 is now ready to use as a beta.
Check out:
Appium 2.0 & # x27; s vision
Before we get into the details of installment and running Appium 2.0, it & # x27; s worth mentioning some of the core goals for this next major revision of Appium:
- Decouple the drivers!Appium & # x27; s program drivers (the XCUITest driver, UiAutomator2 driver, Espresso driver, etc ...) receive very little in mutual with one another. They actually ought to be developed as independent projects that implement the same interface and can be habituate equivalently with the Appium waiter. Appium 2.0 has embraced modular architecture. Drivers are decoupled by design—the norm, not the exception. Today, all major driver (XCUITest, UiAutomator2, Espresso, Flutter, Mac2, Windows and more) are fully supported and easy to establish. This decreases the sizing of an Appium install dramatically and makes it so that you don & # x27; t need to install drivers that you don & # x27; t take to use. It besides makes it possible to freely update drivers independently of Appium and of one another, so that you can get the latest modification for one driver while lodge with a known stable version of another driver, for example.
Also chit:
- Create a driver ecosystem.Once the drivers are decoupled from Appium, it & # x27; s quite an obvious question to ask: what & # x27; s particular about these driver, anyhow? Why couldn & # x27; t anyone else create a driver for their own platform? Well with Appium 2.0, they can, and they should! By using any existing Appium drivers as a template, anyone can create their own custom drivers with a minimum of spare codification. All of these custom drivers can so be install by any Appium user (or impost drivers could be individual, or sold, or whatever you can dream of).
- Create a plugin ecosystem.In addition to drivers, it & # x27; s become clear that there are a huge smorgasbord of use cases for Appium, which affect the use of special commands or special ways of vary the behavior of Appium for specific dictation. Some full illustration of this would be the or the. Not every automation use case postulate these features, but the code and dependance that back these features are included with every Appium install. It would be best to be able to install these lineament as sovereign plugins. And it would be even better for anyone in the world to be able to easily make Appium plugins that can implement new commands or vary the behavior of subsist commands! Plugins are now a powerful, stable component of Appium. The official catalogue, images,
execute-driver, relaxed-caps, universal-xml, plus popular community additions like AltUnity and motion, proffer everything from image acknowledgement to expanded contexts. All are alive, documented, and trust in production. - Miscellaneous standardisation. There has been a lot of deferred work on Appium that maintain getting pushed off because it could introduce a breaking change into the API. We & # x27; re going to take the opportunity to make those changes now and maintain bring Appium into the future.
Read:
What ’ s Really Changed in Appium 2.0 Protocols
1. Full Shift to W3C WebDriver Protocol
Appium 2.0 drops support for JSONWP (JSON Wire Protocol) and MJSONWP (Mobile JSON Wire Protocol). Those be legacy protocols from the Selenium and early Appium day. Appium 2.0 now supportsonlythe standardised W3C WebDriver Protocol.
2. Vendor-Prefixed Capabilities Required
In W3C WebDriver, anything that isn ’ t a standard capability (likeplatformName or browserName) must be prefix for namespacing. Appium anticipate a prefix likeappium:. For example:
'appium: platformVersion' 'appium: deviceName' 'appium: automationName '
Without that prefix, Appium 2.0 will reject your capabilities.
3. No More Backward Compatibility
Unlike Appium 1.x, which indorse both W3C and the older JSONWP/MJSONWP (permit senior node preserve working), Appium 2.0 enforces W3C only. That means you ’ ll need update guest that understand W3C WebDriver.
Appium 2.0 vs Appium 1.x: What ’ s Different
1. Architecture: Monolithic → Modular
- Appium 1.xbundled everything in one package: drivers, nucleus waiter, Inspector—all in one monolith.
- Appium 2.0travel modular. The core server is skimpy, and drivers and plugins are separate. You pick what you involve. Makes updates lighter, and alimony cleaner.
2. Drivers: Always Included → Install As Needed
- In v1.x, driver for Android, iOS, and others be installed by default.
- In v2.0, you install drivers via CLI (e.g.,
appium driver install uiautomator2). They ’ re not shipped by default. Slimmer footprint, more control
3. Plugins: None → Extendable Ecosystem
- v1.xhad zero plugin support—everything was hardcoded.
- v2.0introduces a plugin ecosystem. Think image comparison, custom logging, gestures, reporting, yet new host behaviors. Installable and injectable.
4. Protocol Support: Legacy + W3C → W3C Only
- v1.xsupported bequest protocols (JSONWP, MJSONWP) alongside W3C WebDriver.
- v2.0dip legacy protocols—strictly W3C. That means any non‑standard capability must use the
appium:vendor prefix.
5. Capabilities: Free-for-all → Namespaced
- v1.xlet you slap capabilities without namespaces.
- v2.0enforces W3C criterion: solely
platformName and browserNameare employ as-is; everything else require appium:.
6. Server Base Path:/wd/hub → /
- v1.xdefault server path was
http: //localhost:4723/wd/hub. - v2.0simplifies that to
http: //localhost:4723/. You can notwithstanding bring back/wd/hub using -- base-path=/wd/hub, if needed.
Installing Appium 2.0
At the minute, Appium 2.0 is not the principal line of Appium development, so it can not be installed with a simple npm install -g appium. Instead, Appium 2.0 beta will be available with a special NPM tag following, so you can install it on any platform using NPM as follows:
For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.
That & # x27; s it!
Installing Appium drivers
At this point, after install Appium 2.x for the initiative time, if you run the host, you & # x27; ll get a line in the logs that looks something like this:
[Appium] No driver have be establish. Use the & quot; Appium driver & quot; command to install the one (s) you want to use.
Also read:
(And you & # x27; ll get the same message with respect to plugins). What this is telling us is that you need to have Appium install a driver before you run any tryout. That & # x27; s because no drivers are include by default with Appium 2.x. Instead, you tell Appium which drivers you care to use. Those driver can then be withdraw or update as necessary, all without having to modify your variant of Appium! So, let & # x27; s guide a looking at the commands you could use to install, say, the XCUITest and UiAutomator2 drivers:
appium driver install xcuitest appium driver install uiautomator2
So essentially, there is now a new set of & quot; subcommands & quot; for the main Appium program you run from the CLI. The subcommand we & # x27; re look at here is the driver subcommand, which has itsownset of subcommands! The one we just saw here is the install subcommand for the driver CLI. In the normal case, it takes a single parameter which is the name of the driver you want to install. How did I know which strings to use (xcuitest and uiautomator2)? Well, Appium cognise about some & quot; official & quot; drivers which you can install just by name. To get a list of all these & quot; official & quot; drivers, you can run Appium driver leaning (see below).
See:
Before we talk about driver tilt, let & # x27; s search the driver install command a bit more. The full specification for the command look like this:
appium driver install -- source=-- package=
The -- source option
The -- source selection is not required, but can be included to tell the driver install command where to find the driver you want to install, if you & # x27; re not install one of Appium & # x27; s & quot; official & quot; drivers. Basically it say Appium how it should treat the installSpec you include, and opens up the possibility of installing drivers from practically anywhere! There are 4 selection here:
| Source |
Meaning |
npm |
Install a driver as an NPM package |
github |
Install a driver from a GitHub repo |
git |
Install a driver from an arbitrary Git repo |
local |
Install a driver from a local path on the filesystem |
We & # x27; ll talk about what each of these mean for installSpec in a moment.
Also see:
The -- bundle choice
If you use the -- source option, and if your root is something former than npm, then you must also include this -- package choice, and its value take to be the software name of the driver module. The driver doesn & # x27; t actually need to bepublishedto NPM or anything, but since every Appium driver is a Node.js software, it will have a package name which Appium will need to know in order to discover the driver when it is downloaded and installed.
The installSpec argument
The exclusively required parameter is what we call the & quot; install specification & quot;. It can be in different formats depend on your source. The following table illustrates the possibilities:
| Source |
Install Spec Format |
Example |
(no root) |
The name of an official driver, as found in appium driver tilt |
xcuitest |
npm |
The name of an NPM package plus any valid NPM restrictions or shred (which could be installed |
customDriver @ 1.0.2 |
github |
The GitHub org and repo as/ |
appium/appium-xcuitest-driver ``/" |
git |
The fully qualified Git URL of the repo |
https: //github.com/appium/appium-xcuitest-driver.git |
local |
The way to the driver on the disk |
/usr/local/drivers/custom-driver |
Install Plugins for Appium
One of the biggest alteration in Appium 2.0 is the unveiling of aplugin ecosystem. Plugins allow you to extend Appium ’ s core functionality—whether that ’ s adding custom commands, tweaking server behavior, or enhancing reporting. Unlike Appium 1.x, where everything was hardcoded into the server, Appium 2.0 LET you pick and choose plugins as you need.
How to Install Plugins
You can manage plugins directly from the Appium CLI, just like driver:
appium plugin install -- source=npm appium-wait
In this example, we ’ re installing the appium-wait plugin from npm.
Verify Installed Plugins
To check which plugins are presently installed:
appium plugin listing
This will display all available plugins on your scheme.
Activate Plugins
When depart the Appium server, you involve to enable plugins explicitly:
appium -- use-plugins=wait
You can enable multiple plugins at once by separating them with comma:
appium -- use-plugins=wait, relaxed-caps
Other driver CLI commands
A few times we & # x27; ve mentioned the importance of Appium driver list. What does this command do? It recite you which drivers you have establish, and which official drivers youcouldinstall that you haven & # x27; t yet! For example, this is the output when I & # x27; ve installed only the XCUITest driver:
✔ Listing available drivers - xcuitest @ 3.31.5 [installed (NPM)] - uiautomator2 [not installed] - youiengine [not installed] - window [not installed] - mac [not installed] - espresso [not installed] - tizen [not instal] - to-do [not installed]
Any driver that are installed will expose their variant, and which source was involved in establish the drivers. You can also use driver list to check and see if any drivers get any updates available:
appium driver list -- updates
If an update is available, you & # x27; ll see that in the yield. You can so update a specific driver as follows:
(Where driverName is the gens of the driver as publish in the output of Appium driver list.) Note that by default Appium will not let you update a driver across a major version boundary, to continue you safe from breaking changes. Once you & # x27; ve done your due diligence on any breaking changes with the next major version of a driver, you can proceed with the upgrade as follow:
appium driver update -- insecure
Also, you can updateallinstalled drivers in one go, using the particular driver gens installed:
appium driver update install
And that & # x27; s about it for the driver CLI! Note that you can of class also uninstall especial driver if you no long want them around (this is likewise how you & # x27; d update non-NPM found drivers, use a combination of uninstall and so instal again):
Setting the driver repository location
One question you might have had is: where does Appium install driver when you use the driver CLI? By default, Appium creates a concealed directory called .appium inside your user domicile directory. But if you & # x27; d like to use a different directory, or if you desire to keep multiple driver depositary around, you can conform this route by utilise one of these three command line option (which are all aliases of the same behaviour):
For example, appium -ah /path/to/custom/appium/home driver install xcuitest.
More to arrive ...
Today, drivers and plugins are mature, production-ready, and well-supported by open documentation and migration guidebook. If you ’ re on Appium 1.x, now ’ s the time to even up, this ecosystem is ready and true.