-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Can not see elements inside WebView Element with XCUITest on simulator(with UIAutomator2 it works) #19961
Comments
It usually means the XCTest framework (appium relies on) didn't detect elements inside WkWebView. https://appium.github.io/appium-xcuitest-driver/latest/preparation/#accessibility-settings would help to expose elements as possible. |
I understand what you are saying, but it does not explain why on simulator it does not work and on real device it works fine. My expectation would have been the other way around. |
Only Apple could answer for it. The attached accessibility settings is one possible method to expose more elements afaik based on my past experience. I'm not sure if they help for WebView contents though. |
Thank you for your help. Will try and come back with a conclusion. |
You may also verify if you can connect to the web view using Safari remote debugger. Because if the latter does not detect it we won't be able to do that as well. |
@mykola-mokhnach Not sure how I can do that since my app is not hybrid, but rather it is a native app that at one point takes you to a screen that is a webview. Are there any instructions on how to connect to that webview using Safari remote debugger? |
https://webkit.org/web-inspector/enabling-web-inspector/ Below implementation in an app is hybrid we usually say.
|
@mykola-mokhnach @KazuCocoa I just verified, and it seems for Android the elements in the webview are accessible on emulators, but on real devices, the elements inside are initially available, then if I start scrolling down through the article list in screen, then the elements inside the webview element no longer appear in the page source. Any ideas why this behavior is occurring on Android? |
I assume this is how rendering there works. You could try to play with |
So for iOS I talked to the devs to add isInspectable=true, but for android I don't understand why for emulator it works (although it generates all content in the webview all at once, even if certain elements are not actually in the viewport) and for real devices I just see the webview element and nothing in it. Does android have something like isInspectable? |
It highly depends on the framework used in your app. Make sure you follow the documentation for it. |
Closed as not an issue |
@mykola-mokhnach Could you please reopen this issue? The reason for my request is that when running a manual test session on Saucelabs, the elements inside the webview are rendered correctly in the xml page source, but locally I still can not see anything in the webview element in the xml page source. |
I assume asking Sauce support to check their configuration like accessibility configuration on the device would help |
Already asked what capabilities they are using, but not reply yet. They also they gave me a link to this page: : https://medium.com/@atifqamar29/debugging-ios-webviews-on-safari-browser-822def097497. But I already configured my own iphone with those setting from the page, and still no luck |
Based on my experience, simulators and real devices could have different behavior in iOS, thus possibly such diff also could cause this kind of diff. |
But, on both Saucelabs and locally I am running my test on a real device. So no simulators involved now, but still see the difference in how the page source is rendedered, and I can't figure out why. |
I'm not Sauce person, so I don't know of their internal. It sounds like the only thing is asking for their support. Did both devices have the same accessibility config etc? I wondered also if debuggable signed app https://appium.github.io/appium-xcuitest-driver/latest/preparation/#webview-testing could do it |
Do I have the most recent component updates?
Is the component officially supported by the Appium team?
Is there an existing issue for this?
Current Behavior
When using ignoreUnimportantViews(false) in conjunction with enableMultiWindows(true), in my native iOS app, when I am redirected to a screen that represents a webview (app is native so no webview context available), the only element I see in the page source is an element of type XCUIElementTypeWebView, but can not see the elements inside it, when using simulator
On Android I am able to see all content and elements in the webview element, when using emulator.
Expected Behavior
Expected behavior was to be able to see all elements in the webview on iOS. like I am able on Android
Minimal Reproducible Example
The repository is private
Environment
appium --version
): 2.5.1node --version
): v21.7.1npm
version (output ofnpm --version
): 10.5.0Link to Appium Logs
No response
Further Information
[
iOS.json
android.json
android.txt
iOS.txt
](url)
The text was updated successfully, but these errors were encountered: