I am automating some tests a real device (iOS) using Appium and Cucumber. My idea is to do the following steps:

  • Open the app
  • Do some tasks
  • Launch Safari
  • Navigate to a website, lets say google.com for example

My approach is the following:

  • I create the Driver with my app capabilities
  • Do what I need
  • Clear the Driver
  • Create a new driver with Safari capabilities
  • Navigate to www.google.com

The code looks something like this:

Appium::Driver.new(app_capabilities, true)
# do what I need on the app

Appium::Driver.new(browser_capabilities, true)
# do what I need on the browser

The problem I am having is that Safari doesn't launch. Although if I use only one Driver with the browser capabilities it does launch.

Anyone has any idea this is happening? Or maybe a better strategy?

I'm writing ruby but I don't mind code in other languages.

  • 1
    I'm not familiar with ruby, but I'd guess that the instance of the driver isn't meant to be created more than once.
    – Kate Paulk
    Commented Dec 22, 2017 at 12:21
  • Can't say offhand on question itself, but couldn't you use appium.io/docs/en/commands/device/activity/start-activity instead of creating a new driver?
    – Cynic
    Commented Jul 3, 2018 at 0:02

1 Answer 1


You can just get chrome to run as if it's on the iPhone , this is easier than driving the browser on the phone. http://sites.google.com/a/chromium.org/chromedriver/mobile-emulation

This might not be suitable for everything but it's fine for reasonably simple usages and works for other devices not just iPhones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.