How to change WEBVIEW with it's index instead of WEBVIEW name?


For AndroidDriver -

If I get the two WEBVIEWs with the same name then if i want to pick second webview then how can I achieve this.

For Example

And I want to pick 2nd one.


User xpath?
like /WEBVIEW[2]/


Hi Alex,

I didn’t get you. I wanted to switch 2nd Webview then how i can switch it.

I gave examples - of available webviews not xpath. It is make sense.

In Addition, i also want to make a note that - i tried to switch it in loop and trying to change it’s context but it get stuck while changing. And Appium log states like Device is not online.

So can it be the issue when i am changing context. I am assuming like due to same webview name, i am not able to switch context.