What is WebDriverAgent
Last year's SeleniumConf, Facebook launched a new iOS mobile testing framework - WebDriverAgent, the time of the tweet, written also only supports the simulator. Six months had passed, and now look at the official GitHub - https://github.com/facebook/WebDriverAgent , it has claimed support real test of the (pro-test does support). I put it in the ReadMe carry over:
WebDriverAgent at the end iOS implements a WebDriver server , we can help this server remote control iOS devices. You can start, kill applications, click, scroll view, or to determine whether the correct page display. This makes it a perfect tool for application end-to-end testing or general purpose device automation. ( It says it is on iOS a perfect e2e automation solutions) It Works by Linking
XCTest.framework
and Calling the Apple's API to the Execute Commands Directly ON A device. (link toXCTest.framework
call Apple's API commands executed directly on the device) WebDriverAgent iS aT Facebook Developed and Used for End-to-End Testing and iS successfully Adopted by Appium . (Appium package work in progress, if once the package is good, then since you can directly binding Appium provided a.) it iS Rate this page Currently Maintained by Marek Cirkos and Mehdi Mulani .
It has the following features:
- Real machine and emulator support
- Implements most of WebDriver spec
- Support the USB for Devices, the so-called usb support, referring to the devices do not need the Internet, the current client binding yet.
- It provides an Inspector
- Easy development cycle as it can be launched & debugged directly via Xcode
- Unsupported yet, but works with tvOS & OSX
The use WebDriverAgent
To get the project set up just run bootstrap script:
./Scripts/bootstrap.sh
It will:
After it is finished you can simply open WebDriverAgent.xcodeproj
and start WebDriverAgentRunner
test and start sending requests.
More about how to start WebDriverAgent here.
The official document said very clearly, there is little pit. Carthage is used to solve xcode project dependent, you may know cocoapod , Carthage understand that you put into cocoapod and the same thing can be, can be brew install carthage
installed. npm is used to construct Inspector, Inspector react an application through an HTTP request sent to WebDriverAgent return structure of the page.
Here is my run ./Scripts/bootstrap.sh results:
➜ WebDriverAgent git:(master) ./Scripts/bootstrap.sh
Fetching dependencies
*** Checking out KissXML at "5.0.3"
*** Checking out peertalk at "5a0495a7b7d81b68e25ea1933c755b677cb040da"
*** Checking out RoutingHTTPServer at "v1.0.0"
*** Downloading ocmock.framework binary at "OCMock 3.2.2"
*** Checking out ocmock at "v3.2.2"
*** xcodebuild output can be found in /var/folders/11/wh7ypz2s7q17lxxjphxd4z6h0000gn/T/carthage-xcodebuild.XhkH5T.log
*** Building scheme "OCMock iOS" in OCMock.xcodeproj
2016-05-14 17:45:36.012 xcodebuild[14231:270807] [MT] DVTPlugInManager: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
2016-05-14 17:45:36.159 xcodebuild[14231:270807] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/UncrustifyPlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-05-14 17:45:36.160 xcodebuild[14231:270807] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/