Skip to main content

selenium chrome extension with shortcuts to control driver and element

Project description

Easy Chrome

Description

This package is used as an extension to selenium chrome WebDriver. It contains shortcuts to control driver more easily.

Features

  1. Auto download chromedriver by webdriver_manager with custom cache.
  2. Shortcuts to control driver and element.

Examples

  • init chrome driver.
from easy-chrome import Driver
driver = Driver.set_chrome(headless=True)
  • wait an element located by XPATH to be visible in DOM.
// bare usage
WebDriverWait(driver, wait_time).until(EC.visibility_of_element_located((By.XPATH, xpath))

// with easy-chrome
driver.wait_visible(xpath)
  • get local storage.
// bare usage
driver.execute_script("return window.sessionStorage.getItem(arguments[0]);", key)

// with easy-chrome
driver.get_local_storage(key)
  • wait username input field to be visible in DOM, clear the content and write username to it.
input_xpath = "//input[@id='username']

// bare usage
WebDriverWait(driver, wait_time).until(EC.visibility_of_element_located((By.XPATH, input_xpath)).clear()
sleep(0.2)
WebDriverWait(driver, wait_time).until(EC.visibility_of_element_located((By.XPATH, input_xpath)).sendkeys(username)

// with easy-chrome
driver.wait_visible(input_xpath).clear_and_type(user_name)

Source Code

The source code is currently hosted on GitHub at: https://github.com/wcuong/easy-chrome

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

easy-chrome-2.0.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

easy_chrome-2.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file easy-chrome-2.0.1.tar.gz.

File metadata

  • Download URL: easy-chrome-2.0.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for easy-chrome-2.0.1.tar.gz
Algorithm Hash digest
SHA256 61da24b55993d6d4968dfda790ce6c94fb5264e240a17517fda4b39bb2c65707
MD5 1effb2f7b7cfb0c25d335547e5cad3d7
BLAKE2b-256 6fb7e177e417c94b61dd082cd1684849b1cac7c28e3d8df557f48f64aba67592

See more details on using hashes here.

Provenance

File details

Details for the file easy_chrome-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: easy_chrome-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for easy_chrome-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20eb82cb0ab4370443f1bdada22c3588abd6e75be3ea34e8856bcfdf607fa9cf
MD5 4b76913d87c3173452ea53fcc0fb9aaf
BLAKE2b-256 ea56d7d1ae0d8c28eb051582401a0eba10c3ad9e802890cf14503b8285cac971

See more details on using hashes here.

Provenance

Supported by

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