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

Uploaded Source

Built Distributions

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

Uploaded Python 3

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

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for wd-0.1.10.tar.gz
Algorithm Hash digest
SHA256 d8f930416dd291a8f9014f0202aa87b617ec9452e5e96160843f00c93221a27a
MD5 c051bd441b88384a696746e581df6dc1
BLAKE2b-256 1d30a327688f7fd1453a35a71ddbdc981f23154a92ce717f7dcefc352b73f908

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wd-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f29c13f873f3e2309db2a02283c184c572df502ea0a3bd283418c5a44390c16f
MD5 be0f8359e71c5c799709171197213349
BLAKE2b-256 c8d2596afbd803de2252a616130afd2fc93211112a5885e796b846c4a6f6418f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wd-0.1.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e2f9f07c7e567ec8a73ab73b0cf15623da22b32f60aded87712353eb53428b96
MD5 622b6c8437cd7b6a541b9f2ac5c81b22
BLAKE2b-256 da1ea469b9715d6dc8f0a103a293128852322322a52bf46e350ae9abcb6c7dc7

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