Running mobile safari tests on real device - appium v0.6.0

1,383 views
Skip to first unread message

Budha

unread,
May 29, 2013, 7:10:29 PM5/29/13
to appium-...@googlegroups.com
Hello,

I have a bunch of selenium based web tests that I need to execute on real IOS device (mobile safari). Hence, I was really excited when I saw that Appium v0.6.0 release notes mentioned the "ability to talk to mobile Safari on a real device over USB". I tried executing a very simple test on an iPad mini but it failed with an error (detailed below). Here are some additional details:

Device / Environment Details:
*  iPad Mini - 64 GB with 4G (connected via USB)
* IOS version 6.0.2
* Xcode - 4.6.2 on Mac Mountain Lion (10.8.3)

In order to start using appium on real device, I carried out the following steps:
* Installed nodejs/npm
* sudo npm install -g mocha
* sudo npm install -g grunt-cli
* ./reset.sh --ios --dev
* connected the iPad mini using USB

Started appium with the following command-line parameters:
* node server.js --address autoserver.abc.corp.net --port 4723 --udid xxxxx30ecefa3d586ee2f96151xxxxxxxxx --keep-artifacts --force-ipad --safari 

Then executed a sample test:

public class GoogleTest {
public static WebDriver driver;
public static void main(String args[]) throws Exception{
DesiredCapabilities capabilities = new DesiredCapabilities();
//capabilities.setCapability("device", "iPhone Simulator");
capabilities.setCapability("app", "safari");
driver = new RemoteWebDriver(new URL("http://autoserver.abc.corp.net:4723/wd/hub"), capabilities);
driver.get("http://google.com"); 
driver.get("http://www.google.com"); 
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Cheese!");
element.submit(); 
System.out.println("Page title is: " + driver.getTitle());
driver.close();
driver.quit();
}
}

But this results in the following error (visible in the server logs):

  info: [INST STDERR] 2013-05-28 17:02:57.854 instruments[77385:707] Exception during preparation: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
  info: [INST STDERR] 2013-05-28 17:02:57.859 instruments[77385:707] Automation Instrument ran into an exception while trying to run the script.  NSInvalidArgumentException
  info: [INST] 2013-05-29 00:02:57 +0000 Fail: An error occurred while trying to run the script.
       2013-05-29 00:02:57 +0000 Fail: The target application appears to have died
  Instruments Trace Complete (Duration : 4.171924s; Output : /Users/abc/automation/appium/code/appium/instrumentscli0.trace)
  info: [INSTSERVER] Instruments exited with code 0
  error: Instruments did not launch successfully, failing session
  error: Failed to start an Appium session, err was: Instruments did not launch successfully--please check your app paths or bundle IDs and try again
  info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started","origValue":"Instruments did not launch successfully--please check your app paths or     bundle IDs and try again"},"sessionId":"16f55f97-ded9-49e4-a809-5294fdff6f73"}

They look like IOS instruments related errors. Any idea whats wrong here? Am I missing any step? Do I need to carry out any additional provisioning on the real device?

Looking forward to some directions to resolve this issue.

Thanks,
Budha

Sergio Neves Barros

unread,
May 30, 2013, 4:45:32 AM5/30/13
to appium-...@googlegroups.com
Budha,

Appium is now able to interact with any web view using a remote debugger (through the usb lead). 

You will need to install and run the latest ios-webkit-debug-proxy (pull it from github).
See the hybrid tutorial for a description on how to set this up.

The way you can test your site is by using e.g. the WebViewApp (in the sample code) and deploying that to your device.

Correct me if I am wrong anyone. I don't think we can launch the safari app just yet on an a device.

Sergio

Jason Huggins

unread,
May 30, 2013, 8:05:03 AM5/30/13
to Sergio Neves Barros, appium-...@googlegroups.com

On May 30, 2013 3:45 AM, "Sergio Neves Barros"

> Correct me if I am wrong anyone. I don't think we can launch the safari app just yet on an a device.

This might be a use-case where you'd *have* to use a real physical robot to interact with the screen-- at least for finding and launching Mobile Safari.

- Jason

Jonathan Lipps

unread,
May 30, 2013, 11:16:27 AM5/30/13
to Jason Huggins, Sergio Neves Barros, appium-...@googlegroups.com
Has no one been able to get Safari to launch on a real device by using its bundle id?

I haven't, but I haven't been able to get any app to launch on a real device :-)

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dan Cuellar

unread,
May 30, 2013, 11:18:13 AM5/30/13
to appium-...@googlegroups.com, Sergio Neves Barros, ja...@jrandolph.com
Did I just see "need" and "robot" in the same sentence?

Sergio Neves Barros

unread,
May 30, 2013, 11:34:45 AM5/30/13
to appium-...@googlegroups.com

I like this guy. Upside he is small enough to fit in your carry on luggage. Downside he has no fingers to press any buttons :)

Sergio

On Thursday, 30 May 2013 00:10:29 UTC+1, Budha wrote:

Dan Cuellar

unread,
May 30, 2013, 12:43:59 PM5/30/13
to appium-...@googlegroups.com
No worries, hugs has the robots covered.



Budha

unread,
May 30, 2013, 1:39:13 PM5/30/13
to appium-...@googlegroups.com
Oh! for some reason, I was under the impression that the tests run against the "real" mobile safari app on the IOS device. What if I manually launch safari on the IOS device for now; will appium be able to interact with it then?

In any case, I will try executing it using the ios-webkit-debug-proxy and WebViewApp method. 

Thanks for the information, Sergio. 

-Budha
Reply all
Reply to author
Forward
0 new messages