Handle browser elements using webview

Hello guys I have a specific requirement. In our app there is a button that is in webview and when we click on it it redirects to a browser. My requirement is to handle the elements of that browser. when i try to find the context of the browser it displays as webview but unable to find the elements. Do I need to change the context from webview to some other view

Because app package for the browser is different than your app package name so along with element locator strategy you have to provide package name too.

Hi so I have to give the package name of the browser and then find the element …is that it…If so can u pls tell me the how I can use the locating strategy with the package name… Just a little of sample code would do.

Something like this -

driver.findElement(By.xpath(“//android.webview.Layout[contains(@resource-id, ‘com.android.chrome:id/’ )]”));

If you share screenshot of browser along with uiautomatorviewer or appium inspector then I can tell you exact locator.

what would be the method to find element on iOS Device?

Hello, I am struggling with a similar scenario, are you able to help me, please?