import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class SafariLaunchIOS {
public static void main(String args[]) throws MalformedURLException{
WebDriver driver = null;
DesiredCapabilities caps = DesiredCapabilities.iphone();
caps.setCapability("appiumVersion", "1.4.0");
caps.setCapability("deviceName","iPhone 6");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("platformVersion","8.2");
caps.setCapability("platformName", "iOS");
caps.setCapability("browserName", "Safari");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), caps);
System.out.println("Launched application "+driver);
driver.get("https://www.google.co.in/");
}
}
I have started the Appium server and then run this code. I got below error:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip') (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 321 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'XYZ.local', ip: 'P.Q.R.S', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)
at mobile.SafariLaunchIOS.main(SafariLaunchIOS.java:31)
Can anyone help in this scenario?
Thanks.
Best Regards,
Aniket Gadre
“Programming can be fun, so can cryptography; however they should not be combined.”
More information around how you setup your Appium server would be helpful; in addition, are you "pre-launching" Safari?
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/31b56843-a3fa-4fce-a5b5-2367c272fe70%40googlegroups.com.
Best Regards,
Aniket Gadre
“Programming can be fun, so can cryptography; however they should not be combined.”