Skip to main content

Macaca Python Client

Project description

https://img.shields.io/coveralls/macacajs/wd.py/master.svg https://img.shields.io/travis/macacajs/wd.py/master.svg https://img.shields.io/pypi/v/wd.svg https://img.shields.io/pypi/pyversions/wd.svg https://img.shields.io/pypi/dd/wd.svg

Intro

WD.py is a Python WebDriver client implemented most of the APIs in the WebDriver Protocol. It was originally designed for Macaca (A Node.js powered WebDriver server), but also available for any other implementation of WebDriver server such as Selenium, Appium and etc.

Homepage

WD.py’s documentation.

Examples

>>> from macaca import WebDriver, WebElement

# Configure the desired capabilities.
>>> desired_caps = {
    'autoAcceptAlerts': True,
    'browserName': 'Chrome',
    'platformName': 'desktop'
}

>>> driver = WebDriver(desired_caps)

# Start the WebDriver session
>>> driver.init()

# Support fluent API
>>> driver.set_window_size(1280, 800).get("https://www.google.com")

# Get WebElement instance through element_by_* APIs.
>>> web_element = driver.element_by_id("lst-ib")
>>> print(type(web_element))
macaca.webelement.WebElement

# WebElement include methods such as send_keys, click, get_attribute and etc.
>>> web_element.send_keys("macaca")
>>> web_element = driver.element_by_name("btnK")
>>> web_element.click()

# WebDriver also has some properties like source, title and current_url.
>>> html = driver.source
>>> print('Does Macaca exist: ', 'macaca' in html)
Does Macaca exist: True
>>> title = driver.title
>>> print(title)
macaca - Google Search

Changelog

Details changes for each release are documented in the HISTORY.rst.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wd-0.1.3.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

wd-0.1.3-py2.py3-none-any.whl (22.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file wd-0.1.3.tar.gz.

File metadata

  • Download URL: wd-0.1.3.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wd-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ee00e93a09e5d035ec480517a83e87086bae8ea133e1942004093337538fcc77
MD5 2e672fba7095d9860b94cddb856510c2
BLAKE2b-256 c12ed02884377c03e9b4b117bc55a3d53bbee8786b4ec637eaaee2e4dbfb4b59

See more details on using hashes here.

File details

Details for the file wd-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for wd-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9b16a299599fec3aaacaf26b4a9a15dee98bb6203e7f417beb6c57ff45a5f8ed
MD5 a09a7c501cac9c5e4c0443577a4e3de6
BLAKE2b-256 0d007d4df0787ee0742738c05235da1a1d4d8c1b0973fba4d55ca27ad5f1ee94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page