A common scenario for using the
xcuitrunner is to launch WebDriverAgent on your iOS device.
xcuitrunner ships with the Appium flavor of WebDriverAgent, which is launched by default,
unless you specify another copy of WebDriverAgent.
The WebDriverAgent is an open source WebDriver server implementation for iOS that can be used to remotely control iOS devices. WebDriverAgent is maintained by Facebook.
Appium adopted WebDriverAgent to implement test automation on iOS devices. Over time, Appium started to maintain its own flavor (or fork) of WebDriverAgent. The Appium flavor of WebDriverAgent tends to evolve faster and include more functionality than the original version from Facebook.
Whenever your start a test automation session on an iOS device, Appium will install WebDriverAgent on your device. When you request Appium to execute commands (such as finding an element or clicing on one), Appium forwards these commands to WebDriverAgent running on your iOS device.
In most scenarios, Appium acts as a very thin ‘front-end’ to WebDriverAgent. In some cases, Appium intercepts your commands and preprocesses them. Appium uses a plugin system to support multiple operating systems. Each plugin is called a ‘driver’. The Appium driver which uses WebDriverAgent is called appium-xcuitest-driver and is available on GitHub.
xcuitrunner installs and launches WebDriverAgent on your mobile device, and provides you with
a HTTP endpoint you can use to communicate directly with WebDriverAgent.
xcuitrunner is cross-platform - it runs on Windows, Mac and Linux, and takes care of code signing
for you. There’s no dependency on Xcode.
xcuitrunner does not preprocess any commands you send to WebDriverAgent. Sending commands directly
to WebDriverAgent is in most cases similar to sending those commands to Appium, but not all.
This section highlights commonly encountered differences between Appium and WebDriverAgent:
/appium/app/launchcommand is replaced by the
POST /appium/app/resetcommand is not implemented. You can use
ideviceinstallerto obtain similar behavior.
/window/current/sizecommand is not implemented. Use
GET /window/sizeinstead. The
/element/:elementId/sizecommands are replaced by a single
GET /element/:elementId/rectcommand, which includes both the location and size of the element.
/appium/device/hide_keyboardcommand is replaced by the
/wda/keyboard/dismisscommand. In certain scenarios, this command may not work correctly and a workaround is needed.