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

WebDriver: Retry fetching content description #1939

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

pocmo
Copy link
Contributor

@pocmo pocmo commented Aug 23, 2024

Proposed changes

This is a workaround for the WebDriver problem described in #1936. We are filling a login form and press the login button. During that navigation there's a short time where the content description is null which results in a forced crash.

With this workaround we try again to fetch the content description for a limited time until we finally give up.

Testing

Tested locally with Chrome 128.0.6613.85.

Issues fixed

Closes #1936.

if (contentDesc == null) {
retry++
}
if (retry == 10) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Let's extract 10 to some constant.
  2. Let's add issue link to the comment for context. E.g. See issue #1936

Copy link
Contributor

@bartekpacia bartekpacia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! Thanks

@pocmo
Copy link
Contributor Author

pocmo commented Aug 26, 2024

Thank you. I updated the PR.

@bartekpacia
Copy link
Contributor

Thanks, LGTM.

@bartekpacia bartekpacia merged commit 8436d5e into mobile-dev-inc:main Sep 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebDriver: IllegalStateException: Could not retrieve hierarchy through maestro.getContentDescription()
2 participants