I'm getting an error: "AttributeError: 'WebDriver' object has no attribute 'desired_capabilities'"

Hello and welcome to this community.

When asking or troubleshooting about the problems you encounter, you should give the more information possible about it. Just writing a title and a screen capture of code and errors is not enough.

Please write about the system you are using, the versions of the supporting software (Python and Robot Framework), and also about the involved Libraries versions.

Your error message is typical for a version, or setup problem.

1 Like

I am studying a course that uses the Robot Framework to automate mobile tests using Appium and an Android rmulator.

Python version - 3.12.1
Robot Framework - 7.0 (Python 3.12.1 on win32)
AppiumLibrary Version - 2.0.0

If you need any more information, please tell me

How do you start Appium Server?

This is my script:

SET JAVA_HOME=D:\Programas\jdk-11.0.2
SET PATH=%JAVA_HOME%\bin;%PATH%
@REM Start server
appium server --base-path /wd/hub

Then you may see similar output:

D:\tests>appium server --base-path /wd/hub
[Appium] Welcome to Appium v2.0.1
[Appium] Non-default server args:
[Appium] {
[Appium]   basePath: '/wd/hub'
[Appium] }
[Appium] Attempting to load driver xcuitest...
[debug] [Appium] Requiring driver at C:\Users\USERNAME\.appium\node_modules\appium-xcuitest-driver
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at C:\Users\USERNAME\.appium\node_modules\appium-uiautomator2-driver
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723/wd/hub
[Appium] You can provide the following URLS in your client code to connect to this server:
[Appium]        http://192.168.51.1:4723/wd/hub
[Appium]        http://192.168.199.1:4723/wd/hub
[Appium]        http://192.168.1.21:4723/wd/hub
[Appium]        http://127.0.0.1:4723/wd/hub (only accessible from the same host)
[Appium] Available drivers:
[Appium]   - xcuitest@4.33.2 (automationName 'XCUITest')
[Appium]   - uiautomator2@2.29.4 (automationName 'UiAutomator2')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.

An important part, is the previous installation of the drivers:

Available drivers:
[Appium]   - xcuitest@4.33.2 (automationName 'XCUITest')
[Appium]   - uiautomator2@2.29.4 (automationName 'UiAutomator2')
1 Like

I am getting a similar error after upgrading python library selenium to 4.17.0, I believe it’s related to this change from the release notes: “remove deprecated desired_capabilities property from webdriver”

Maybe it will be fixed by this PR: use capabilities instead of desired_capabilities by tkoukkari · Pull Request #414 · serhatbolsu/robotframework-appiumlibrary · GitHub

Estou com o mesmo problema, vi que é ao utilizar o Click Text, se utilizar o Click Element com um xpath dá certo. Estou fazendo o mesmo curso do papito rs. Se conseguir alguma solução para funcionar o Click Text, me avise.

change the selenium version to 4.12, worked for me
pip install selenium==4.12

1 Like

I had the exactly same issues for ‘click test’. The solution from this link solve the problem. Thanks!!!