Appium on OSX Yosemite
OSX Yosemite is going to be released soon with Xcode 6 and iOS8 support. I have installed latest public beta version of the OSX Yosemite. Just given a try to setup Appium to see if it supports iOS8.
Requirements
- Mac OSX with Yosemite
- Xcode 6
- Ruby-Cucumber
- NodeJS
- BDDfire [Optional]
Setup
I will be using Ruby-Cucumber-Capybara framework with Appium, I have writen and Gem called ‘BDDfire‘ to setup framework in a minute.
BDDfire
We can crreate a project directory and install framework
1 2 3 |
$ mkdir appium-yosemite-ios8 $ cd appium-yosemite-ios8 $ sudo gem install bddfire |
Now we have all the directory setup for appium with all capybara and cucumber.
Install RubyGems
Now we will ruby 1.9.3 and install all the gems from the Gemfile
1 2 |
$ rvm use ruby-1.9.3-p194 $ bundle install |
It looks like this
Install Node and Start Appium
BDDfire has created ‘package.json’ with Appium dependency in it. We will update it with latest version of the Appium [1.3.0beta1] and install node packages and start Appium server
1 2 |
$ sudo npm install $./node_modules/.bin/appium |
This will start Appium server on port 4723
Run Cucumber with Appium
BDDfire has a cucumber profile ‘appium_ios’ to run cucumber scenarios with Appium. Capybara driver configuration looks like this
1 2 3 4 5 6 7 |
Capybara.register_driver :appium_ios do |app| capabilities = {:platformName => 'iOS', :platformVersion => '8.0', :deviceName=> 'iPhone Simulator', :browserName => 'Safari', :version => '6.0'} Capybara::Selenium::Driver.new(app, :browser => :remote, :desired_capabilities => capabilities, :url => "http://0.0.0.0:4723/wd/hub") end |
We can run cucumber like this
1 |
$ bundle exec cucumber -p appium_ios |
Appium and iOS8
Appium support for iOS8 is still progress, you can watch this GitHub thread. Now we will see some of the basic issues you will face and possible solutions.
Automation Trace Error
Xcode 6 has not AuomationInstrument.bundle directory so you probably see this error.
Solution to this is copy all content from AutomationIntrument.xrplugin to newly created AutomationInstrument bundle
Instrument Error
Sometimes, you will see an error
1 |
A new session could not be created. (Original error: Instruments crashed on startup) (Selenium::WebDriver::Error::WebDriverError) |
This is unsolved error and we will hopefully get solution to this issue to work on iPhone Simulator soon.
The Xcode6 launch the Simulator but stucks
You can fing source code on GitHub
https://github.com/Shashikant86/appium-yosemite-ios8
Watch YouTube video demo
In the next post, I will try it from my iPhone 6 real device and see if it works.
Thanks a lot to all @AppiumDevs for all your support.