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.

Sample

WD.py’s sample.

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.

Contributing

See CONTRIBUTING.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-1.0.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

wd-1.0.0-py2.py3-none-any.whl (23.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for wd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f493aacf5537b6d4ed282d20f01d980b2002b3f35c3976421585d52be8628e3a
MD5 c4186730e244663e4987ecfaaad695a0
BLAKE2b-256 d0e025b01b59b3664ae921f38ab9189e48a03916164b9256bbe62120c654b3f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wd-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c7e110bff99fffd517ed17713691b3f2c3937b4e10d605171ba0b7c805dd1d53
MD5 62540163ffd99ed6cad12a3a114670f9
BLAKE2b-256 1653132b8c174ebbe5b8ccf9f28b9e6e85e4017c42f9312d1af04cb7a1425c8d

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