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.