Issues automating mobile Chrome on Android emulator

Hello,
I am trying to automate mobile browser (Chrome) with Appium Python Client. I am using a very simple script created following one of Jonathan Lipps’ courses. This is the part that doesn’t work:

CAPS = {
“platformName”: “Android”,
“browserName”: “Chrome”,
“appium:options”: {
“platformVersion”: “11.0”,
“deviceName”: “Android Emulator”,
“automationName”: “UiAutomator2”
}
}

driver = webdriver.Remote(
APPIUM, options=UiAutomator2Options().load_capabilities(CAPS))

I keep getting the following error:
selenium.common.exceptions.InvalidArgumentException: Message: All non-standard capabilities should have a vendor prefix. The following capabilities did not have one: automationName

But it makes no sense, I am using the syntax recommended in the official documentation. Anyway I tried different notations but the result is always the same.
Any idea? Please help me, I am stuck.

I am using Appium 2.5.1 and Appium-Python-Client 3.2.1.

It’s always helpful to link the course and explain what step you are having trouble with. Makes it much easier to reproduce.

More important is the Selenium binding (you have a Selenium error) and Python version. Without knowing what those are I’m guessing it’s a version incompatibility. Here is the compatibility matrix and more explaination:

1 Like

Thanks for the answer!

The course was Test Automation with Python: 8 Additional Appium Features, the unit Web App Testing, final example. Even though I had to slightly modify the script in order to make it work.

Anyway, Python version is 3.10.8. Selenium is 4.17.2. According to the matrix I should be in the first row, with the most updated versions.

I found the problem! It was tricky, I started writing the script by copying and pasting a previous one, in which I was automating the desktop browser. So I had imported the webdriver from Selenium instead of Appium.
By replacing “from selenium import webdriver” with “from appium import webdriver”, the script works! The course did not mention this passage… Anyway, good to know! The error wasn’t very explanatory :sweat_smile:

1 Like