It contains 2 UIATextField’s and one UIATextField[1]
When I look for the elements while still in the native context, they are all found. In addition, I can click the button object while in the native context (strange)…
But when I switch to the WEBVIEW_1 context, none of the elements can be seen. Any ideas why?
BTW, while in native context I can see the Email element using this locator:
“//UIAScrollView/UIAWebView/UIATextField[@value=‘Email’]”
But while in WEBVIEW_1 context the element cannot be found using that locator, nor these:
“//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIATextField[1]”
“//UIAWebView/UIATextField[1]”
“//UIATextField[1]”
QUESTION: While in a webview context, do we need to use a locator strategy other than the above?
You can’t access nor manipulate UI elements without switching contexts, I was just giving Jeffrey a simpler solution to inspect for elements instead of getting the whole HTML source.
I was wondering if anyone made progress on this. I’m using the IOSDriver, and after switching to the webview, I can find elements that exist by using linkText.
I can’t find UIAButtons by using findElementsByName(). However, if I use an appium inspector, I am able to locate the UIAButtons by switching the context to webview, and then searching by the UIAButton’s name.
(I can switch context and locate a UIAButton by name using Appium Inspector, but not while running a test. It does work for finding elements by link text though.)
@Hassan_Radi i checked the link and i found that its given only for ANdroid…
How to inspect WEBVIEW elements for IOS hybrid app.
I tried switching context to WEBVIEW and dumped the pageSource and started picking elements from the source file. But for some objects i was not able to figure out the elements manually.
Is there any way to inspect elements in iOS hyrbid App;s webview
Thanks