🐞 bug: <title>Using "--allow-insecure chromedriver_autodownload" start appium server. But switch_to.context('WEBVIEW_com.jackpot.farm.eggs') not work #20886
Description
Is there an existing issue for this?
- I have searched the existing issues
Appium Version
2.13.1
Appium Host Type
Command Line
Are you using Appium components not maintained by the Appium team?
No response
Is this issue reproducible using the latest components?
- I confirm the issue is still reproducible with the latest component versions
Current Behavior
When I run the driver.contexts code, I get ['NATIVE_APP', 'WEBVIEW_com.jackpot.farm.eggs']. But when I ran driver.switch_to.context('WEBVIEW_com.jackpot.farm.eggs'), it failed.
Expected Behavior
Run the driver.switch_to.context('WEBVIEW_com.jackpot.farm.eggs') success
Appium Log
No response
Environment Details
- Debug details (
appium --show-debug-info
): - Last component version(s) which did not exhibit the problem:
- Platform and version of device under test:
- Real device or emulator/simulator:
Minimal Reproducible Example
def android_driver(device: dict):
desired_caps = {"appium:appWaitDuration": 60000, "appium:skipLogcatCapture": True,
"appium:disableSuppressAccessibilityService": True, "platformName": "Android",
"appium:automationName": "uiautomator2", "appium:newCommandTimeout": 0,
"autoGrantPermissions": True, "appium:adbExecTimeout": 120000, "appium:noReset": True,
"appium:uiautomator2ServerLaunchTimeout": 120000, "appium:udid": device.get("appium:udid"),
'skipServerInstallation': True, 'skipDeviceInitialization': True
}
# "autoWebviewTimeout": 60000
driver = webdriver.Remote('127.0.0.1:4723',
options=UiAutomator2Options().load_capabilities(desired_caps),
)
driver.update_settings({'waitForIdleTimeout': 0})
driver.update_settings({'allowInvisibleElements': True})
driver.update_settings({'ignoreUnimportantViews': True})
driver.update_settings({'enableMultiWindows': True})
return driver
driver_test = android_driver({"appium:udid": '172.16.9.189:20142'})
contexts = driver_test.contexts
driver_test.switch_to.context('WEBVIEW_com.jackpot.farm.eggs')
appium.log
Further Information
Command to start the appium service: appium --allow-insecure chromedriver_autodownload --session-override
I'm connected to a cloud phone, and the browser I've simply developed is based on chroium.