question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test iOS app with real device , driver.quit() throw exception

See original GitHub issue

Description

when i test iOS app with real device, the afterTest() method throw exception. but this method is success in version 1.5.3.

Environment

java client build version: 4.1.2 Appium server version: 1.6.0-beta1 Desktop OS: OSX El Capitan 10.11.6 Node.js version 6.5.0 Mobile platform/version under test: iOS Real device or emulator/simulator: real device

Details

test iOS app with real device, the beforeTest() method and the test are correct. But run to the afterTest ,“driver.quit();” method throw a webdriverException.

Code To Reproduce Issue [ Good To Have ]

`public class SimpleTest {

private static IOSDriver<MobileElement> driver;
private String deviceName;
private String platformName;
private String platformVersion;
private String udid;
private String app;
private String bundleId;

@Test public void testLogin() { System.out.println(driver.getPageSource()); }

@BeforeClass public void beforeClass() throws InterruptedException {

  deviceName = "iPhone5s";
  platformName = "iOS";
  platformVersion = "9.3";
  udid = "26378cb9bca6165915278f7afb38aa0b432c5381";
  app = "/Users/gaojiewen/Library/Developer/Xcode/DerivedData/"
        + "语音信箱-efrgkaqmpsyueggibdtnqonlpuun/Build/Products/Debug-iphoneos/Voicemail.app";
  bundleId = "com.voicemail.iflyzunhong";

  DesiredCapabilities ca = new DesiredCapabilities();
  ca.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
  ca.setCapability(MobileCapabilityType.PLATFORM_NAME, platformName);
  ca.setCapability(MobileCapabilityType.PLATFORM_VERSION, platformVersion);
  ca.setCapability(MobileCapabilityType.APP, app);

  ca.setCapability(IOSMobileCapabilityType.BUNDLE_ID, bundleId);
  ca.setCapability(MobileCapabilityType.UDID, udid);
  ca.setCapability(MobileCapabilityType.NO_RESET, Boolean.TRUE);

  driver = new IOSDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), ca);

}

@AfterClass public void afterClass() { driver.quit(); } }`

Ecxeption stacktraces

https://gist.github.com/wenshi11019/835929f91f567f4bcc85cade28f960aa

Link to Appium logs

https://gist.github.com/wenshi11019/e50f6ad517c7c83ea6f64afea575decb

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hazmeistercommented, Sep 5, 2016

It looks like you are deploying the wrong file. .app files only work with the simulator. You will need to build an ipa file and use that for your real device.

0reactions
lock[bot]commented, Apr 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error when launching iOS device in appium
For real device, reconnect iOS cable and try running the code. Share.
Read more >
Cannot get mobile web on iOS 7 on physical device to work
public void tearDown() throws Exception {. driver.quit();. } @Test ... info: Not setting iOS and app preferences since we're on a real device....
Read more >
Test iOS apps on AWS Device Farm using Appium – Part 1
With AWS Device Farm, you can quickly get started testing your Android, iOS, and FireOS apps on real devices in the AWS cloud....
Read more >
How To Improve Appium Test Speed and Reliability - HeadSpin
Unwarranted assumptions made by the test author about app or device speed, app state, ... public void testLogin_StaticWait() throws InterruptedException {
Read more >
appium-xcuitest-driver - npm
Connected real devices must be trusted, added to your developer profile and configured properly along with WebDriverAgent signing. Read Real ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found