Hi, currently I have implement a code where I initiate Android driver and perform some actions in NATIVE_APP context, in a later stage I open Chrome and navigate into a link. When running
androidDriver.getContextHandles();
I see the NATIVE_APP context that I’m in and also WEBVIEW_chrome context for chrome. When I try to switch to WEBVIEW_chrome I get a timeout error as the context is not found.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded
Build info: version: '4.3.0', revision: 'a4995e2c09*'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [10d01107-deda-4a39-b8b2-cbc8792b61a5, switchToContext {name=WEBVIEW_chrome}]
Capabilities {appium:chromeOptions: {w3c: false}, appium:chromedriverExecutable: C:\Automation\chromedriver1..., appium:databaseEnabled: false, appium:desired: {chromeOptions: {w3c: false}, chromedriverExecutable: C:\Automation\chromedriver1..., deviceName: android phone, newCommandTimeout: 450000, platformName: android, platformVersion: 9, udid: RF8M607Q48K}, appium:deviceApiLevel: 28, appium:deviceManufacturer: samsung, appium:deviceModel: SM-A105F, appium:deviceName: RF8M607Q48K, appium:deviceScreenDensity: 280, appium:deviceScreenSize: 720x1520, appium:deviceUDID: RF8M607Q48K, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:networkConnectionEnabled: true, appium:newCommandTimeout: 450000, appium:pixelRatio: 1.75, appium:platformVersion: 9, appium:statBarHeight: 54, appium:takesScreenshot: true, appium:udid: RF8M607Q48K, appium:viewportRect: {height: 1328, left: 0, top: 54, width: 720}, appium:warnings: {}, appium:webStorageEnabled: false, platformName: ANDROID}
Session ID: 10d01107-deda-4a39-b8b2-cbc8792b61a5
This is the code I use to switch context
for (Object contextHandle : androidDriver.getContextHandles())
{
if (contextHandle.toString().toUpperCase().contains("WEBVIEW"))
{
androidDriver.context(contextHandle.toString());
return;
}
}
If I go back to Chrome version 87, all works as should. I am using Appium version 7.3.0 and server 1.22.3. Thanks in advance.