Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failed to create snapshot when rendered HTML have pseudo elements in XCode 11. #14194

Closed
kimjg opened this issue Apr 17, 2020 · 7 comments
Labels
Needs Info typically non-actionable; needs author to respond ThirdParty upstream problems XCUITest regarding xcuitest driver

Comments

@kimjg
Copy link

kimjg commented Apr 17, 2020

The problem

Hi.
We are doing an integrated test of the mobile device well using the features you provided. First of all, thank you for this.

We found an issue with Xcode 11.
The problem is below.

Due to some pseudo elements rendered in the WKWebView on iOS built in Xcode 11, it seems that there is an error creating a snapshot.
(rf: pseudo elements: https://www.w3schools.com/css/css_pseudo_elements.asp)

The pseudo elements identified as having problems are :: after, :: before.
If the elements are included in the rendered html, snapshot creation fails.
We are temporarily building via Xcode 10, but we hope to fix the problem as soon as possible. Thank you.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.17.0
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: macOS Mojave 10.14.6
  • Node.js version (unless using Appium.app|exe): 6.9.0
  • Npm or Yarn package manager: npm
  • Mobile platform/version under test: Xcode 11.3.1 / iOS 13.1
  • Real device or emulator/simulator: Real device
  • Appium CLI or Appium.app|exe: Appium CLI

Link to Appium logs

Cannot take the snapshot of Window after 15 seconds
2020-04-17 14:01:43.511077+0900 WebDriverAgentRunner-Runner[5069:1155365] Internal error: Error Domain=com.apple.dt.xctest.automation-support.error Code=5 "Error kAXErrorIPCTimeout getting snapshot for element <AXUIElementRef 0x100d5ac40> {pid=5028} {uid=[ID:9999 hash:0x6de2ed5000000000]}" UserInfo={NSLocalizedDescription=Error kAXErrorIPCTimeout getting snapshot for element <AXUIElementRef 0x100d5ac40> {pid=5028} {uid=[ID:9999 hash:0x6de2ed5000000000]}}

Code To Reproduce Issue [ Good To Have ]

It is returned as an error in the reply block of the code.

https://github.com/appium/WebDriverAgent/blob/master/WebDriverAgentLib/Categories/XCUIElement%2BFBUtilities.m#L123

@kimjg kimjg changed the title Failed to create snapshot when rendered HTML have pseudo elements in XCode 11. [BUG] Failed to create snapshot when rendered HTML have pseudo elements in XCode 11. Apr 17, 2020
@mykola-mokhnach
Copy link
Collaborator

Unfortunately the snapshotting error itself is thrown by xctest. We cannot do nothing about it. However, it is possible to tune some snapshotting parameters (like snapshotTimeout or snapshotMaxDepth), which could make snapshotting possible. See

Also, please try it with appium@beta, so we know the most recent fixes are included

@mykola-mokhnach mykola-mokhnach added Needs Info typically non-actionable; needs author to respond ThirdParty upstream problems XCUITest regarding xcuitest driver labels Apr 17, 2020
@kimjg kimjg closed this as completed Apr 17, 2020
@mykola-mokhnach
Copy link
Collaborator

mykola-mokhnach commented Apr 17, 2020

@kimjg Please share which solution helped in your case, so other people would know what to do

@kimjg kimjg reopened this Apr 17, 2020
@kimjg
Copy link
Author

kimjg commented Apr 17, 2020

@mykola-mokhnach
I haven't solved this yet.
Since you said it was a problem with XCTest, so I think I should wait until Apple fixes it.

Should I close this issue after it is resolved?

If so, close it later when I find out how to fix this issue, or when the modified version is applied to appium@beta you mentioned. :)

@mykola-mokhnach
Copy link
Collaborator

Since you said it was a problem with XCTest, so I think I should wait until Apple fixes it.

You would probably have to wait forever :(

Try the apply the workarounds above and let us know if it worked. Also, investigate the resulting device logs. Usually XCTest writes a lot of useful debug info there.

@kimjg
Copy link
Author

kimjg commented Apr 17, 2020

@mykola-mokhnach
I understand what you said.
I've already applied what you suggested before creating an issue.

However, it is not a snapshotTimeout problem, but a parsing error.
Adjusting the snapshotMaxDepth wasn't what I wanted, because it was processed just before the Depth containing pseudo elements. I want a snapshot containing all elements.

And appium@beta has already tried, but it same too.
As you said, because it is a problem with XCTest, I judged that there is nothing more to check, so I answered it as above.

Thanks for the quick answer, and finally I'll do what you suggested.

Also, investigate the resulting device logs. Usually XCTest writes a lot of useful debug info there.

But.... I am already figuring out the cause of this issue (it's caused by pseudo elements parsing error). After all, I think it's a problem Apple needs to fix, and I want to send an email to Apple.

What do you think?

I am sorry to close the issue without posting it as a result of your suggestion. It was my first time creating an issue, so I didn't know well. Thank you.

@mykola-mokhnach
Copy link
Collaborator

Have you tried to exclude the visibility attribute from the snapshot like it is stated in one of the linked issues?

@mykola-mokhnach
Copy link
Collaborator

Closed because of no response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Info typically non-actionable; needs author to respond ThirdParty upstream problems XCUITest regarding xcuitest driver
Projects
None yet
Development

No branches or pull requests

2 participants