How to handle Sign-in via a mobile Browser

Hello, Within our app the sign-in page redirects from our app to a browser to go through the auth process. The Appium inspector shows Webview context(s) detected; however, I am told by our developer that it’s a native browser, not a webview, as it’s not embedded into the app.
My requirement is to handle the elements of that browser so I am able to add the relevant details to complete the sign-in process.
As it stands i get the error NoSuchContextException
I’m sure more details may be required to get to the bottom of this however i thought this was a good place to start.
Any help would be appreciate and thanks in advance

Any help would be appreciated.

Try to proceed as is. e.g. first element by class name android.widget.TextView is username. Second is password.

Hi Aleksei, thanks so much for your reply. Your help is appreciated however when i try your idea i get the below error-

Code
driver.findElement(AppiumBy.accessibilityId(“Sign In”)).click(); //Accessing the sign in button from the 1st screen
Thread.sleep(10000);
driver.findElement(By.className(“android.widget.EditText”)).sendKeys(“Adam@test”);strong text

Error
org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters.

Also if i try switching context i get the below error

Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Can’t stop process; it’s not currently running (cmd: ‘C:\Users\adaml\Docs\chromedriver --port=8000 --adb-port=5037 --verbose’)

Build info: version: ‘4.10.0’, revision: ‘c14d967899’

System info: os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.6’

Driver info: io.appium.java_client.android.AndroidDriver

Command: [186df977-9fdf-4913-95ec-68a4db82b598, switchToContext {name=WEBVIEW_chrome}]

Share page source right after fail at https://gist.github.com/ and give link to check.

You cant switch context as this view not part of your app.

PS and use AppiumBy.className(…

 /**
 * Switches focus to specified Context
 * - web
 * - native
 *
 * @param {string} context
 */

async switchToContext(context)
{
const contexts = await driver.getContexts();
const view = contexts.filter((app) => app.includes(context.toUpperCase()));
if (view.length > 0)
{
await driver.switchContext(view[0]);
}
else { throw Error(${context} not found. Here are the options: ${contexts}); }
}