-
Notifications
You must be signed in to change notification settings - Fork 390
[v1.28.0] Not able to inspect elements in WebView (android, emulator, API 33) #1126
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
Comments
@Dambakk can you please name the apk ? or you can share the application on which you are getting the error ? |
Can you DM in the maestro slack? I can share it with you there :) |
I have similar issue. I'm trying to interact with elements in webview but Maestro sees whole screen as an element. Do you have a detailes documentation about testing webview with Maestro? |
Same here. Using Maestro studio and an Android apk when I open a webview, I can only do tapOn on the webview, I can't assert on any elements of the webview as Maestro Studio doesn't see them. |
Still happens on 1.35.0 |
+1 it seems webview on android doesnt work for certain things, we would also need the webview to behave the same in android and ios |
+1 I face this issue too, sometimes it detects the entire webview as a single component in android but sometimes, its able to view the hierarchy of the components inside webview. |
Could this be related to leancodepl/patrol#244? (I'm experiencing the same issue with a Flutter InAppWebView btw) |
It's possible, but unfortunately people who reported this problem in this issue don't specify what technology their app is built in – so we're not sure if it's only Flutter. |
@bartekpacia they mention I'll give it a new try with the new Flutter release 3.24 and report back |
No luck with 3.24 |
It is sill a problem on API 34, maestro 1.37.9. (Android Native) |
Is someone able to provide an APK to test with? I'd love to work out what's going on here. |
I won't say that this problem applies to a specific APK, as in my tests I've noticed that the problem sporadically happens for the same APK and emulator/devices. |
Sounds like a Studio bug then, if it's only reproducible intermittently? |
Yes, it has happened on our tests that run on CI. Edited: it does look more stable nowadays, so I wonder if there is anything to do with some version of the WebView installed in the emulator. I won't have the version of the WebView that I identified the problem though. |
Running into this when running tests on infinite retry till fail (in an attempt to reduce test flake). After max ~3 passes I see assertVisible failures from Maestro, and when firing up maestro studio on the still running app instance I can clearly see that Maestro is simply not "diving into" the iframe in the webview and is instead seeing the entire iframe as a single block with no searchable content. Recordings (and physical device inspection) clearly show that the content is very much present at the time the assertVisible fires and it's Maestro failing to traverse the iframe's in the webview (or a failure deeper in Android accessibility APIs itself feasibly). For now worked around it by modifying my Maestro test run wrapper to entirely ignore any failures with 'WebviewInspectable' in the assert and asserting that previous to the real assertVisibles (and injecting that text invisibly in my web views... and praying it won't cause a test vs production diff). |
This comment has been minimized.
This comment has been minimized.
Will add some observations from when I last saw this:
I didn’t get to the bottom of it at the time because we decided to stick with API 30 devices for our testing, but I’d like to be able to use newer ones so hoping some of the above sparks some inspiration into the problem. |
Hey folks - there is a new experimental option available that may resolve this issue. Please give it a try and let us know how it goes! Add appId: com.example.app
androidWebViewHierarchy: devtools
---
- launchApp |
@Leland-Takamine , unfortunately the issue still occurs.
|
@nielsdekeijzer would you be able to provide a repro case that we can test on our end? |
This reverts commit d400644.
* Ensure the CI is marked as failed when Maestro test is failing * Fix typo in String to disable bookmark in ChromeCustomTab * Fix Maestro test now that matrix.org is using MAS to authenticate. * Fix Maestro test - other issues due to recent changes. * Maestro: add test on Element Call * Run through Chrome on boarding step. * Try suggestion from mobile-dev-inc/Maestro#1126 (comment) * Revert "Try suggestion from mobile-dev-inc/Maestro#1126 (comment)" This reverts commit d400644. * Add comment on Maestro flow.
Describe the bug
I am not able to assert that some text is visible in an Android WebView when targeting API 33. The hierarchy does not contain any of the texts I expect, and Studio does not let me inspect any of the elements. (I also experience the same on my Pixel device running Android 14 preview) It works on emulator targeting API 32.
Slack thread discussing the issue: https://mobile-dev-inc.slack.com/archives/C041FU72T54/p1685687193237819
Cloud run that fails because of this: https://console.mobile.dev/uploads/290128bd-c337-499b-a1f9-a7aa6ef9109c?teamId=d654771a-0d9f-4d20-9c2a-c0dcd36c08b5&appId=69c4e90d-9edc-4c1f-82bd-03d096219a01&analysisId=36fe9c6b-eee0-4f15-a87d-a2894e9c8aab&checkIdx=0
To Reproduce
See the cloud run above to see the issue, but in short;
Expected behavior
I want to be able to assert visibility of elements in a Android WebView.
Screenshots

Environment information (please complete the following information):
The text was updated successfully, but these errors were encountered: