can't interact with xcuielements inside a wkwebview

Number:rdar://36788196 Date Originated:January 23 2018
Status:Open (Duplicate of 36550947) Resolved:
Product:XCode Product Version:9.2 (9C40b)
Classification: Reproducible:Always
it was noticed that even though the xcuielements are displayed in a debugprint, we're not able to interact with them (e.g. fetch label, tap, verify existence, etc). instead, it generates the following errors:

1) in the case of waiting for element to exist:
"Assertion failure in -[XCElementSnapshot replaceDescendant:withElement:], /BuildRoot/Library/Caches/"

2) in the case of trying to interact with the element:
"failed: caught "NSInternalInconsistencyException", "Invalid parameter not satisfying: [descendant _isDescendantOfElement:self]""

Steps to Reproduce:
1. import the project attached and run the ui tests.

Expected Results:
1.1. developer is able to interact with xcuielements inside webviews
1.2. all ui tests in this project pass

Actual Results:
1.1. errors are displayed
1.2. all ui tests in this project fail with the errors described in the summary

- XCode 9.2 (9C40b)
- iPhone 8 Plus simulator with iOS 11.1



Closed as duplicate (original message)


Engineering has determined that your bug report (36788196) is a duplicate of 36550947 and will be closed.

The open or closed status of the original report your bug was duplicated to appears in a text box within the bug detail section of the bug reporter user interface. For security and privacy reasons, we don't provide access to the original bug yours was duped to.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!