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.

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.9.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

wd-0.1.9-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wd-0.1.9.tar.gz
Algorithm Hash digest
SHA256 039d5f953a9e37154c4ca8f7689ca4f068ff28bb8a5f762e98c8d3b1ece37a74
MD5 51509d3c81cd6944f100324e3e8aa32e
BLAKE2b-256 2a080c5d0d953eaf4335a11249ed718270af9095244087e5db3bfc66fcc477b7

See more details on using hashes here.

File details

Details for the file wd-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for wd-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 e99f5c9a9a31a5c0b4459820f8fba05912e4b9a2debde3e49caee2963a077fe6
MD5 06ae15e20af31f03099faa8504fe0e48
BLAKE2b-256 251d1200274ba365c0f3019e1bbaa64fa3e0451c67223ee10307a848eca04fc7

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