Appium-Python-Client-Monkey 1.0.0

Creator: bradpython12

Last updated:

Add to Cart

Description:

AppiumPythonClientMonkey 1.0.0

Appium Python Client Moneky
Hot Patch For Appium-Python-Client


An extension library for adding WebDriver Protocol and Appium commands to the Selenium Python language binding for use with the mobile testing framework Appium.
Notice
Since Appium_Python-Client v1.0.0, only Python 3.7+ is supported.
Since Appium_Python-Client v2.0.0, the base selenium client version is v4.
The version only works in W3C WebDriver protocol format.
If you would like to use the old protocol (MJSONWP), please use v1 Appium Python client.
More Reference
Getting the Appium Python client Monkey
There are three ways to install and use the Appium Python client.


Install from PyPi, as
'Appium-Python-Client-Monkey'.
pip install Appium-Python-Client-Monkey

You can see the history from here


Install from source, via PyPi. From 'Appium-Python-Client',
download and unarchive the source tarball (Appium-Python-Client-Monkey-X.X.tar.gz).
tar -xvf Appium-Python-Client-Monkey-X.X.tar.gz
cd Appium-Python-Client-Monkey-X.X
python setup.py install



Install from source via GitHub.
git clone git@github.com:CN-Robert-LIU/appium-python-client-monkey.git
cd appium-python-client-monkey
python setup.py install



Usage
The Appium Python Client is fully compliant with the WebDriver Protocol
including several helpers to make mobile testing in Python easier.
To use the new functionality now, and to use the superset of functions, instead of
including the Selenium webdriver module in your test code, use that from
Appium instead.
from appium import webdriver

from appium_patch import monkey
webdriver.Remote = monkey.patch_all()

From there much of your test code will work with no change.
As a base for the following code examples, the following sets up the UnitTest
environment:
# Android environment
import unittest
from appium import webdriver
from appium_patch import monkey
webdriver.Remote = monkey.patch_all()


desired_caps = dict(
platformName='Android',
platformVersion='10',
automationName='uiautomator2',
deviceName='Android Emulator',
app=PATH('../../../apps/selendroid-test-app.apk')
)
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
el = self.driver.find_element_by_accessibility_id('item')
el.click()

# iOS environment
import unittest
from appium import webdriver
from appium_patch import monkey
webdriver.Remote = monkey.patch_all()


desired_caps = dict(
platformName='iOS',
platformVersion='13.4',
automationName='xcuitest',
deviceName='iPhone Simulator',
app=PATH('../../apps/UICatalog.app.zip')
)

self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
el = self.driver.find_element_by_accessibility_id('item')
el.click()

Direct Connect URLs
If your Selenium/Appium server decorates the new session capabilities response with the following keys:

directConnectProtocol
directConnectHost
directConnectPort
directConnectPath

Then python client will switch its endpoint to the one specified by the values of those keys.
import unittest
from appium import webdriver
from appium_patch import monkey
webdriver.Remote = monkey.patch_all()


desired_caps = dict(
platformName='iOS',
platformVersion='13.4',
automationName='xcuitest',
deviceName='iPhone Simulator',
app=PATH('../../apps/UICatalog.app.zip')
)

self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps, direct_connection=True)

Relax SSL validation
strict_ssl option allows you to send commands to an invalid certificate host like a self-signed one.
import unittest
from appium import webdriver
from appium_patch import monkey
webdriver.Remote = monkey.patch_all()


desired_caps = dict(
platformName='iOS',
platformVersion='13.4',
automationName='xcuitest',
deviceName='iPhone Simulator',
app=PATH('../../apps/UICatalog.app.zip')
)

self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps, strict_ssl=False)

License
Apache License v2

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.