Skip to content

Conversation

@zahin178
Copy link
Contributor

@zahin178 zahin178 commented Oct 1, 2023

PR Type

This PR enables one to use Appium with python-appium-client = 3.0 and Selenium >= 4.10.0

Bug Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made.
  • Version number has been updated.
  • Required modules have been added to respective "requirements*.txt" files.
  • Relevant Test Cases added to this description (below).
  • (Team) Label with affected action categories and semver status.

Overview

When tried to run Appium actions got the following errors,

Error 1

WebDriver.__init__() got an unexpected keyword argument ‘desired_capabilities’

From Selenium version 4.10.0 and python-appium-client 3.10 desired_capabilites option has been deprecated. So we cannot provide a dictionary with all the desired capabilities like before. Instead, we have to provide a UiAutomator2Options option object that is created from the desired capabilities dictionary.

Previous
appium_driver = webdriver.Remote("http://localhost:%d" % appium_port, desired_caps)

Current
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
appium_driver = webdriver.Remote("http://localhost:%d" % appium_port, capabilities_options)

Error 2

AttributeError: 'WebDriver' object has no attribute 'launch_app'

Currently, appium remote driver does not have any 'launch_app' attribute. So had to replace 'launch_app' with 'activate_app'.

Previous
appium_driver.launch_app()

Current
appium_driver.activate_app(package_name)

Test Cases

@sazid
Copy link
Member

sazid commented Oct 10, 2023

@zahin178 need to fix the merge conflicts.

@zahin178
Copy link
Contributor Author

@sazid resolved the conflicts.

@sazid sazid changed the title Python appium client 3 0 fix Python appium client 3.x fix Oct 11, 2023
@sazid sazid merged commit e44dc3c into dev Oct 11, 2023
@sazid sazid deleted the python_appium_client_3_0_fix branch October 11, 2023 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants