2

I am trying to automate mobile web testing using ios-driver on an iPhone 6 plus (real device). The Safari browser opens but the specified URL (google.com in this case) is not opened (i.e. only "about:blank page" is displayed).

The configuration as shown on a terminal by running the command java -jar ios-server-standalone-0.6.6-SNAPSHOT.jar -newSessionTimeoutSec 40 -port 4444 -beta is:

Running on: Mac OS X 10.10 (x86_64)
Using java: 1.8.0_45
Using Xcode install: /Applications/Xcode.app
Using instruments: version:6.3.2, build: 57082
Using iOS version 8.3

The device I have connected is also recognized properly.

The Java code I used is as follows:

IOSCapabilities capabilities = IOSCapabilities.iphone("Safari");
capabilities.setCapability(IOSCapabilities.SIMULATOR, false);
capabilities.setCapability(IOSCapabilities.UUID, "UID-of-Device");
capabilities.setCapability("javascriptEnabled", true);
RemoteIOSDriver webDriver = null;
try {
    webDriver = new RemoteIOSDriver(new URL(     "http://localhost:4444/wd/hub"), capabilities);
} catch (MalformedURLException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}
webDriver.get("https://www.apple.com/");
webDriver.quit();

The following error is displayed:

Exception in thread "main" org.openqa.selenium.WebDriverException: is Safari started and with the focus ? 

Any help in solving this error would be appreciated.

1

This looks like an issue with the driver. Looks like a bug with the code.

https://github.com/ios-driver/ios-driver/issues/369

Update 3/24/2017: The linked issue is still open. The driver appears to have continuing issues with this scenario.

  • Yes. I saw that thread and also commented there. Seems that driver is having some issue as till now I am not able to get any solution. – Jigesh Mehta Jul 2 '15 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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