Hi all,
Since the release of Xcode 8 Im sure theres a few of us in the same boat, investigating the new webDriverAgent and XCUITest Driver.
At the moment the forums are a bit lacking in resource which is understandable since this is still in beta, but maybe it’s worth sharing our findings to assist the community in the transition.
I myself have found a couple of issues such as the simulator not launching the application once the webDriverAgent is running. (Still investigating)
How has the transition been for everyone else anything useful people want to share?
I will update my own findings in due course.
Thanks
Update 19/12/2016:
I said I would update everyone on my migration once I had time so here it is!
Sytem information:
OS: Version macOS Sierra version 10.12 (16A323)
Xcode: Version Version 8.0 (8A218a) - I Will be using a dummy application for testing.
Appium: Version v1.6.3 (REV fe0f474b95b42ba670800e3877c5c4ef01beb902) - I Will be targeting simulators initially.
Steps undertaken:
1.Read the migration document it helps!
2.Installed the external dependancies per
3.Installed Appium 1.6.3 via npm
- ‘npm install [email protected]’
4.Test that appium run’s with no errors with no capabilities provided
- cd /Volumes/Macintosh HD/Users/XXXXX/node_modules
- node .
5.Created a test script to launch appium with the correct parameters for the test application.
- StartAppium.sh
contents:
cd "/Volumes/Macintosh HD/Users/XXXXX/node_modules/appium"
node . -a xxx.xxx.xxx.xxx -p 4723 --command-timeout "900" --session-override --debug-log-spacing --platform-version "10.0" --platform-name "iOS" --app "com.xxx.xxx" --no-reset --device-name "AppiumTestDevice-10" --automation-name XCUITest
a. Launched the script to ensure that no errors where present in the startup of the appium instance.
- We use a in house C# framework that we maintain for iOS & Android, so I updated the settings to point to the server and test application. We also pass the capabilities via the framework, so I can remove some of the capabilities from the startup script if I like, usually I have kept these incase I want to use the Appium inspector, but we also have our own inspector.
a. Initially this failed due to having two versions of Xcode installed, core simulator detected Xcode 7.3 not Xcode 8.
Error: simctl error running ‘list’: 2016-12-13 13:42:20.600 simctl[56474:4769997] CoreSimulator is attempting to unload a stale CoreSimulatorService job. Detected Xcode.app relocation or CoreSimulatorService version change. Framework path (/Applications/Xcode-7.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework) and version (209.19)
b. To resolve this issue I set the primary Xcode version
- xcode-select --switch /path/to/Xcode.app
- e.g. sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
This resolved the issue with the wrong Xcode been selected.
c. However my simulator then went into overdrive as it was confused with the multiple instances of Xcode (7.3.1 / 8), restarting the mac resolved the issues and I was able to launch the test application with our in house inspector.
Facebook WebDriverAgent Inspector:
If you don’t have your own inspector don’t worry the Facebook WebDriverAgent has one inbuilt but requires you to compile it from source.
When you launch your application you should see the web driver agent starting in the logs, e.g. web driver agent starting on /localhost:8100…
To launch the inspector go to http://localhost:8100/inspector, in my case I received an error due to ‘value: "Invalid parameter not satisfying: path******’
To fix this issue you have to build the WebDriverAgent yourself, special thanks to
Imparticularly follow
cd ~/"${REPOS}"
git clone https://github.com/facebook/WebDriverAgent.git
cd WebDriverAgent
./Scripts/bootstrap.sh
cd "${APPIUM}"
rm -rf WebDriverAgent
ln ~/"${REPOS}"/WebDriverAgent .
To break this down, get the latest driver from github, build and replace your existing WebDriverAgent with the new.
After this I was able to browse to http://localhost:8100/inspector without the crash.
At this point Im able to launch the test application and inspect to see the differences, it’s too early to make comment on what need’s to be changed for the automated test’s to run smoothly, but the migration document above mentions some.
Will keep everyone posted.