Skip to content
A WebDriver server for iOS that runs inside the Simulator.
Objective-C JavaScript C Shell CSS Ruby
Find file
Latest commit 918d8ad @marekcirkos marekcirkos committed with Facebook Github Bot 7 Not trying to scroll if element is already visible
Summary: allow-large-files

Reviewed By: nqmtuan

Differential Revision: D3069747

fb-gh-sync-id: 4d985e02c5e6f334c91c4f0bb82c6d1705796e38
shipit-source-id: 4d985e02c5e6f334c91c4f0bb82c6d1705796e38
Failed to load latest commit information.
Configurations Moved project settings to conifguration files & restriced warnings
Inspector Removed temporary files from repo
PrivateHeaders Added ability to disable Apple's "waitForQuiescence"
WebDriverAgent.xcodeproj Ensuring element is not being animated, when performing tap
WebDriverAgent.xcworkspace Added xcodeproj & xcworkspace for WebDriverAgent
WebDriverAgent Pull from GitHub with TouchID and free() hack
WebDriverAgentCore Added target-action like request handling
WebDriverAgentCoreTests Added target-action like request handling
WebDriverAgentLib Added target-action like request handling
WebDriverAgentLibTests Fixed UIAWebDriverAgent tests
XCTStubApps Fixed iPad test runner
XCTUITestRunner Improved debug logging for XCTWDA
XCTWebDriverAgentLib Not trying to scroll if element is already visible
.gitignore Created hierarchy inspector
.travis.yml Update .travis.yml
CONTRIBUTING.md Add a CONTRIBUTING file.
LICENSE Initial commit
PATENTS Initial commit
Podfile Added target-action like request handling
Podfile.lock Added peertalk as dependency
README.md Fix "To start tasting app"
build.sh Testing github bot
build_resource_bundle.sh Created hierarchy inspector
startup.sh Initial commit

README.md

WebDriverAgent

WebDriverAgent is a WebDriver server for iOS that runs inside the Simulator and is written entirely in Objective-C.

Build Status

Building

Our dependencies are tracked with CocoaPods. First run

pod install

and then open WebDriverAgent.xcworkspace.

WebDriverAgent workspace contains two kind of WebDriverAgents:

  • UIAWebDriverAgent (that links to UIAutomation.framework)
  • XCTWebDriverAgent (that links to XCTest.framework), also works with devices

UIAWebDriverAgent

UIAWebDriverAgent works under-the-hood by linking to UIAutomation.framework and calling the same APIs that are exposed through Apple's UIAutomation.js framework.

Because it is not tied to an Instruments run, it is able to run across applications or even on the home screen. Furthermore, it's much faster than any JavaScript UIAutomation.js driver as it runs a native HTTP server and does not need to ferry commands and results through a makeshift run loop.

Running UIAWebDriverAgent

To add new commands or just fool around with UIAWebDriverAgent, you can run it from within Xcode. Because UIAWebDriverAgent is a daemon, you will not notice any UI when it runs. Hit the /tree endpoint to confirm it's running.

In practice, you would want to start it up alongside your application. You can use Apple's simctl tool for this or FBSimulatorControl. This is how you might do it with simctl:

# 1. Open the Simulator and application you wish to test.

# 2. Start WebDriverAgent.
xcrun simctl spawn booted <WebDriverAgent_path>
# e.g. xcrun simctl spawn booted /Users/mehdi/src/WebDriverAgent/Build/Products/Debug-iphonesimulator/WebDriverAgent.app/WebDriverAgent

XCTWebDriverAgent

XCTWebDriverAgent works by linking to XCTest.framework and calling the same APIs that are exposed through Apple's XCUITest framework. This approach allows to run tests on devices!

Running XCTWebDriverAgent

To play around with XCTWebDriverAgent you can simply start XCTUITestRunner tests in Xcode or use xcodebuild:

xcodebuild -workspace WebDriverAgent.xcworkspace -scheme XCTUITestRunner -destination id='<DEVICE_UDID>' test

When simlulator/device launches with blue screen it should be ready for receiving requests. To get ip address under with device is available you can check device logs for line "ServerURLHere->[DEVICE_URL]<-ServerURLHere"

Use curl to start testing the app:

curl -X POST -H "Content-Type: application/json" -d "{\"desiredCapabilities\":{\"bundleId\":\"$BUNDLE_ID\", \"app\":\"/path/to/app/on/local/machine/magicapp.app\"}}" http://[DEVICE_URL]/session/

Have fun!

Contributing

See the CONTRIBUTING file for how to help out.

License

WebDriverAgent is BSD-licensed. We also provide an additional patent grant.

Something went wrong with that request. Please try again.