appium: [Xcode] Exiting due to IDE disconnection - after searching by NSPredicate name and label on iOS 14.4

The problem

When the test requests from driver to find an element by “NSPredicate name and value” locator, the WDA crashes and reports xcodebuild exited with code ‘65’ and signal ‘null’. But before searching with “NSPredicate name and value”, test works as usual with other locators.

Especially:

  • works by wdName
  • fails after searching by wdName AND wdLabel

That happens on one device with iOS 14.4, other 2 devices with iOS 13.3 work as usual in the same environment.

The issue started after updating the device from iOS 14.3 to iOS 14.4. Before that tests were running on it normally. After upgrade, every test execution on the mentioned device fails.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.20.0 or 1.21.0-beta.0
  • Last Appium version that did not exhibit the issue (if applicable): 1.20.0 - shouldn’t matter
  • Desktop OS/version used to run Appium: CLI
  • Node.js version (unless using Appium.app|exe): LTS
  • Npm or Yarn package manager: LTS
  • Mobile platform/version under test that exhibits the issue: iOS 14.4
  • Mobile platform/version under test did not exhibits the issue: iOS 14.3
  • Real device or emulator/simulator: real device iPhone7
  • Appium CLI or Appium.app|exe: CLI

Details

Behavior

  1. WDA is built correctly in Xcode.
  2. when the test is run, the app and WDA are installed on device.
  3. after install, the app opens as expected.
  4. after app is opened, the test is able to find and click on element which locators are other than NSPredicate wdName AND wdLabel
  5. then, the test fails when it reaches to the element which locator is NSPredicate wdName AND wdLabel.

The failure log starts with:

[Xcode] 2021-02-19 07:48:14.032291-0500 WebDriverAgentRunner-Runner[1348:967874] [Default] Exiting due to IDE disconnection.
[XCUITest] Error getting screenshot: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

ends with:

[WebDriverAgent] xcodebuild exited with code '65' and signal 'null'

Link to Appium logs

In this log, the test goes few steps forward before reaching to NSPredicate wdName AND wdLabel locator search. Exiting_due_to_IDE_disconnection_2021-02-19

In this log, the test tries to search by NSPredicate wdName AND wdLabel locator at the very beginning and fails. Exiting_due_to_IDE_disconnection_2021-02-17-short

I can provide more logs, but they are very similar to provided logs.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (5 by maintainers)

Most upvoted comments

🥇 BIG THANK YOU 🥇 @Dan-Maor and 🥇 @mykola-mokhnach

You solved the problem 💯

The no_heic patch fixed the WDA crash at screenshoting 👍

Now tests are passing on mentioned iPhone7 device with 14.4 iOS.

Just one note about screenshot quality: when it is default screenshotQuality=1, I see too many of these messages

2021-03-02 16:33:20:432 - [Xcode] 2021-03-02 16:33:20.568470-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:20:432 - [Xcode]
2021-03-02 16:33:21:011 - [Xcode] 2021-03-02 16:33:21.144729-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:21:011 - [Xcode]
2021-03-02 16:33:21:585 - [Xcode] 2021-03-02 16:33:21.720322-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:21:585 - [Xcode]
2021-03-02 16:33:22:132 - [Xcode] 2021-03-02 16:33:22.267819-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:22:132 - [Xcode]
2021-03-02 16:33:22:672 - [Xcode] 2021-03-02 16:33:22.808284-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:22:672 - [Xcode]
2021-03-02 16:33:23:247 - [Xcode] 2021-03-02 16:33:23.384327-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:23:248 - [Xcode]
2021-03-02 16:33:23:798 - [Xcode] 2021-03-02 16:33:23.934492-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:23:798 - [Xcode]
2021-03-02 16:33:24:370 - [Xcode] 2021-03-02 16:33:24.506803-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
2021-03-02 16:33:24:370 - [Xcode]
2021-03-02 16:33:24:944 - [Xcode] 2021-03-02 16:33:25.080646-0500 WebDriverAgentRunner-Runner[2886:2406487] Cannot take a screenshot within 500 ms timeout
...

when it is low screenshotQuality=2, I see few of them.

With screenshot default quality the test execution took 00:05:37 With screenshot low quality the test execution took 00:04:24, more than 1 minute faster.

Screenshots sizes are: Normal quality: 304.6 KB Low quality: 227.3 KB The visual difference is not big but we can save a lot of time at a full run.

Thank you guys once more. You are real savers.

Closing!

I have recently published the patch https://github.com/appium/WebDriverAgent/pull/474, which prevents HEIC screenshots completely. Try it, otherwise I don’t have any more good ideas

I would try to play with the screenshotting settings (e.g. set screenshotQuality to 2) if this also fails with screen recording disabled. Perhaps, the service is simply out of memory.

@uterator I’ve prepared a pull request to ensure that WDA never tries to send two parallel screenshoting requests to testmanagerd. Please check it out and let us know if it it helps to resolve your issue.