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");
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