Hello there,
I’m struggling to perform tests on Android Webview.
I’m using Appium server 1.17 (I keep this one locally because this is the one running on Browserstack too) and my tests are in python with pytest.
I’m able to click on webview element using an emulator but when I try to run it on a real device I have this message :
E selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome ‘119.0.6045’. You could also try to enable automated chromedrivers download server feature. See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md for more details
E Stacktrace:
E UnknownError: An unknown server-side error occurred while processing the command. Original error: No Chromedriver found that can automate Chrome ‘119.0.6045’. You could also try to enable automated chromedrivers download server feature. See https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md for more details
E at getResponseForW3CError (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:804:9)
E at asyncHandler (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:392:37)
First of all, the link provided in the stacktrace redirect to 404
I tried running appium with --allow-insecure chromedriver_autodownload but it does not fix it.
I also tried many other little thing that I don’t remember like switching versions, trying to install it manually and so on.
Desperate, I tried to use the click on coordinate but as I first do a swipe and it does not always result to the same swipe without changing the coordinate or the percent (why btw ?? it works on Appium inspector and I double checked the coordinate on my emulator), so my test is flaky and I really want to do it the right way.
Anyone is able to unblock me with this driver issue ? Or to provide a better way to interact with webview on Android maybe ? Here is the method I use to click on an element :
def tap_on_android_webview_element(driver: WebDriver, element_id, default_wait_interval=10):
# switch context to Weview
driver.switch_to.context('WEBVIEW')
wait(2)
print('Tap on webview element with ID: ' + element_id)
WebDriverWait(driver, default_wait_interval).until(EC.element_to_be_clickable((By.ID, element_id))).click()
# switch context back to Native
driver.switch_to.context('NATIVE_APP')
wait(2)