Skip to content

Commit

Permalink
docs: update README.md for v3 (#912)
Browse files Browse the repository at this point in the history
* docs: update README.md

* Update README.md
  • Loading branch information
KazuCocoa authored Sep 15, 2023
1 parent 31eda4b commit fa7ba6e
Showing 1 changed file with 57 additions and 51 deletions.
108 changes: 57 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,6 @@

An extension library for adding [WebDriver Protocol](https://www.w3.org/TR/webdriver/) and Appium commands to the Selenium Python language binding for use with the mobile testing framework [Appium](https://appium.io).

## Notice

Since **v1.0.0**, only Python 3.7+ is supported.

Since **v2.0.0**, the base selenium client version is v4.
The version only works in the W3C WebDriver protocol format.
If you would like to use the old protocol (MJSONWP), please use the v1 Appium Python client.

### Quick migration guide from v1 to v2
- Enhancement
- Updated base Selenium Python binding version to v4
- Removed `forceMjsonwp` since Selenium v4 and Appium Python client v2 expect only W3C WebDriver protocol
- Methods `ActionHelpers#scroll`, `ActionHelpers#drag_and_drop`, `ActionHelpers#tap`, `ActionHelpers#swipe` and `ActionHelpers#flick` now call W3C actions as its backend
- Please check each behavior. Their behaviors could slightly differ.
- Added `strict_ssl` to relax SSL errors such as self-signed ones
- Deprecated
- `MultiAction` and `TouchAction` are deprecated. Please use W3C WebDriver actions.
- e.g.
- [appium/webdriver/extensions/action_helpers.py](appium/webdriver/extensions/action_helpers.py)
- https://www.selenium.dev/documentation/support_packages/mouse_and_keyboard_actions_in_detail/
- https://www.youtube.com/watch?v=oAJ7jwMNFVU
- https://appiumpro.com/editions/30-ios-specific-touch-action-methods
- https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
- `launch_app`, `close_app`, and `reset` are deprecated. Please read [issues#15807](https://github.com/appium/appium/issues/15807) for more details

#### MultiAction/TouchAction to W3C actions

On UIA2, some elements can be handled with `touch` pointer action instead of the default `mouse` pointer action in the Selenium Python client.
For example, the below action builder is to replace the default one with the `touch` pointer action.

```python
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder

actions = ActionChains(driver)
# override as 'touch' pointer action
actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "touch"))
actions.w3c_actions.pointer_action.move_to_location(start_x, start_y)
actions.w3c_actions.pointer_action.pointer_down()
actions.w3c_actions.pointer_action.pause(2)
actions.w3c_actions.pointer_action.move_to_location(end_x, end_y)
actions.w3c_actions.pointer_action.release()
actions.perform()
```

## Getting the Appium Python client

There are three ways to install and use the Appium Python client.
Expand Down Expand Up @@ -86,12 +41,14 @@ download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz).

## Compatibility Matrix

|Appium Python Client| Selenium binding|
|----|----|
|`2.10.0`+ |`4.1.0`+ |
|`2.2.0` - `2.9.0` |`4.1.0` - `4.9.0` |
|`2.0.0` - `2.1.4` |`4.0.0` |
|`1.1.0` and below|`3.x`|
|Appium Python Client| Selenium binding| Python version |
|----|----|----|
|`3.0.0`+ |`4.12.0`+ | 3.8+ |
|`2.10.0` - `2.11.1` |`4.1.0` - `4.11.2` | 3.7+ |
|`2.2.0` - `2.9.0` |`4.1.0` - `4.9.0` | 3.7+ |
|`2.0.0` - `2.1.4` |`4.0.0` | 3.7+ |
|`1.0.0` - `1.1.0` |`3.x`| 3.7, 3.8 |
|`0.52` and below|`3.x`| 2.7, 3.4 - 3.7 |

The Appium Python Client depends on [Selenium Python binding](https://pypi.org/project/selenium/), thus
the Selenium Python binding update might affect the Appium Python Client behavior.
Expand All @@ -101,6 +58,55 @@ For example, some changes in the Selenium binding could break the Appium client.
> We strongly recommend you manage dependencies with version management tools such as Pipenv and requirements.txt
> to keep compatible version combinations.


### Quick migration guide from v2 to v3
- Replacement
- `start_activity` method: Please use [`mobile: startActivity`](https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-startactivity)
- `launch_app`, `close_app` and `reset` methods: Please refer to https://github.com/appium/appium/issues/15807
- `available_ime_engines`, `is_ime_active`, `activate_ime_engine`, `deactivate_ime_engine` and `active_ime_engine` methods: Please use [`mobile: shell`](https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-shell)
- `set_value` and `set_text` methods: Please use `element.send_keys` or `send_keys` by W3C Actions
- Removal
- `end_test_coverage` method is no longer available
- `session` properly is no longer available
- `all_sessions` properly is no longer available

### Quick migration guide from v1 to v2
- Enhancement
- Updated base Selenium Python binding version to v4
- Removed `forceMjsonwp` since Selenium v4 and Appium Python client v2 expect only W3C WebDriver protocol
- Methods `ActionHelpers#scroll`, `ActionHelpers#drag_and_drop`, `ActionHelpers#tap`, `ActionHelpers#swipe` and `ActionHelpers#flick` now call W3C actions as its backend
- Please check each behavior. Their behaviors could slightly differ.
- Added `strict_ssl` to relax SSL errors such as self-signed ones
- Deprecated
- `MultiAction` and `TouchAction` are deprecated. Please use W3C WebDriver actions.
- e.g.
- [appium/webdriver/extensions/action_helpers.py](appium/webdriver/extensions/action_helpers.py)
- https://www.selenium.dev/documentation/support_packages/mouse_and_keyboard_actions_in_detail/
- https://www.youtube.com/watch?v=oAJ7jwMNFVU
- https://appiumpro.com/editions/30-ios-specific-touch-action-methods
- https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
- `launch_app`, `close_app`, and `reset` are deprecated. Please read [issues#15807](https://github.com/appium/appium/issues/15807) for more details

#### MultiAction/TouchAction to W3C actions

On UIA2, some elements can be handled with `touch` pointer action instead of the default `mouse` pointer action in the Selenium Python client.
For example, the below action builder is to replace the default one with the `touch` pointer action.

```python
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
actions = ActionChains(driver)
# override as 'touch' pointer action
actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "touch"))
actions.w3c_actions.pointer_action.move_to_location(start_x, start_y)
actions.w3c_actions.pointer_action.pointer_down()
actions.w3c_actions.pointer_action.pause(2)
actions.w3c_actions.pointer_action.move_to_location(end_x, end_y)
actions.w3c_actions.pointer_action.release()
actions.perform()
```

## Usage

The Appium Python Client is fully compliant with the WebDriver Protocol
Expand Down

0 comments on commit fa7ba6e

Please sign in to comment.