I’m looking for some help with an issue I’m having automating a hybrid Android app. I’m unsure if this a bug with Appium or an issue with what I’m doing.
A page of our app has several webviews, one for an advert, and several others displaying content, however when I run driver.getContextHandles, I am only getting “NATIVE_APP” and one “WEBVIEW_”. When looking at the pageSource for the returned webview, and comparing it to what I can see in Chrome dev tools when inspecting devices, it appears that Appium is picking up the first webview from the list in Chrome, but none of the others
I did before and it turned out that Chrome remote debugging doesn’t differentiate between WEBVIEWS and Window handles. Check inside the webview for available window handles.
This does get a bit more complicated if trying to establish anything about the windows. For example, several of the available webviews in our app have the same name. The best way to establish the correct webview would be using
driver.manage().window().getPosition
However, this results in an error:
unknown error: command only supported for desktop Chrome without debuggerAddress
From googling the error, it seems this is shown generally for window interactions that Appium no longer supports since the switch to contexts in 1.0. It might be useful for some of this to come back, as on Android I can’t really see any other way to interact with different webviews / windows other than their names
@Hassan_Radi & @jonhw : Thanks a ton. I have followed the above snippet but it didn’t worked out for me. In my application, windows has separate dynamic ID’s instead of name like below:
5454-4934345B13332434W
4734-2SFRW6KE53C546E
All are dynamic in nature.
I’m using java client 1.6.1 Is there any issue due to this??? How to resolve it??