Script execution issue with IOS real device(iphone/ipad) with Appium

226 views
Skip to first unread message

manasi sattarkar

unread,
Jul 6, 2015, 10:23:40 AM7/6/15
to seleniu...@googlegroups.com
Hi,

I want to launch safari browser on iPhone 6 real device through Mac and Appium.

System settings :
Mac 10.10.3
Appium: 1.4.0.
Xcode : 7
iPhone : 6, iOS version : 8.2

My code is :

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.

Shawn Knight

unread,
Jul 11, 2015, 10:15:21 PM7/11/15
to seleniu...@googlegroups.com
More information around how you setup your Appium server would be helpful; in addition,  are you "pre-launching" Safari? 

Aniket Gadre

unread,
Jul 11, 2015, 10:57:33 PM7/11/15
to seleniu...@googlegroups.com
You need to have much more setup to run on real iOS device.
1st thing I noticed that you have specified address as 127.0.0.1 while appium by default start at 0.0.0.0
2nd is you need to install Safari Launcher to invoke iOS safari run on real device
You also need to install ios-webkit-debug-proxy

Best Regards,
Aniket Gadre
 
Programming can be fun, so can cryptography; however they should not be combined.

On Sun, Jul 12, 2015 at 10:15 AM, Shawn Knight <shawn.kn...@gmail.com> wrote:
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.

For more options, visit https://groups.google.com/d/optout.

Aniket Gadre

unread,
Jul 11, 2015, 10:58:42 PM7/11/15
to seleniu...@googlegroups.com
One more thing, use appium group to post your query as you might get better response there

Best Regards,
Aniket Gadre
 
Programming can be fun, so can cryptography; however they should not be combined.

Reply all
Reply to author
Forward
0 new messages