I got the following error logs:
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4.81 seconds
Build info: version: ‘2.47.1’, revision: ‘411b314’, time: ‘2015-07-30 03:03:16’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.mob.safari.SafariLaunch$1
Following are the code:
package com.mob.safari;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
public class SafariLaunch {
AppiumDriver driver;
@Test
public void Launch() {
driver.get("http://google.com");
}
@BeforeTest
public void beforeTest() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("deviceName", "iPhone 6");
capabilities.setCapability(CapabilityType.VERSION, "9.0");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "safari");
URL url = new URL("http", "0.0.0.0", 4723, "/wd/hub");
driver = new AppiumDriver<WebElement>(url, capabilities) {
@Override
public MobileElement scrollToExact(String arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public MobileElement scrollTo(String arg0) {
// TODO Auto-generated method stub
return null;
}
};
}
@AfterTest
public void afterTest() {
}
}
But the MobileSafari.app is showing in following location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications
System Spec:
Xcode: 7.0
Mac OS: 10.11
Appium: 1.4.16
Please help me to resolve this issue.