Skip to main content

A simple library to simplify Selenium automations.

Project description

Easy selenium automation

Easy selenium automation is a simple Python library that simplifies Selenium automations by providing utility functions for common tasks like waiting for elements, clicking, and filling fields.

Installation

You can install the package via pip:

pip install easy-selenium-automation

Usage

  • Here is an example of how to use

from easy-selenium-automation.selenium_utils import wait_element_xpath, click_element_xpath

Example usage in Selenium

driver = webdriver.Chrome()

Wait for an element to be present and click on it

element = wait_element_xpath(driver, "//div[@id='example']", 10) if element: click_element_xpath(driver, "//div[@id='example']", 10)

driver.quit()

Functions

  • wait_element_xpath(driver, xpath, timeout=10): Waits for an element to be present in the DOM by XPath.
  • wait_element_id(driver, element_id, timeout=10): Waits for an element to be present in the DOM by ID.
  • wait_element_name(driver, name, timeout=10): Waits for an element to be present in the DOM by Name.
  • wait_element_class(driver, class_name, timeout=10): Waits for an element to be present in the DOM by Class Name.
  • wait_element_tag(driver, tag_name, timeout=10): Waits for an element to be present in the DOM by Tag Name.
  • wait_element_css(driver, css_selector, timeout=10): Waits for an element to be present in the DOM by CSS Selector.
  • wait_element_link_text(driver, link_text, timeout=10): Waits for an element to be present in the DOM by Link Text.
  • click_element_xpath(driver, xpath, timeout=10): Waits for an element identified by XPath and clicks on it.
  • click_element_css(driver, css_selector, timeout=10): Waits for an element identified by CSS Selector and clicks on it.
  • fill_field_xpath(driver, xpath, text, timeout=10): Waits for an element identified by XPath and fills it with text.
  • fill_field_name(driver, name, text, timeout=10): Waits for an element identified by Name and fills it with text.
  • is_element_present_xpath(driver, xpath, timeout=10): Checks if an element is present in the DOM by XPath.
  • is_element_present_css(driver, css_selector, timeout=10): Checks if an element is present in the DOM by CSS Selector.
  • is_element_present_id(driver, element_id, timeout=10): Checks if an element is present in the DOM by ID.
  • is_element_present_name(driver, name, timeout=10): Checks if an element is present in the DOM by Name.
  • is_element_present_class(driver, class_name, timeout=10): Checks if an element is present in the DOM by Class Name.

License

  • This project is licensed under the MIT License - see the LICENSE file for details.

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_selenium_automation-0.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_selenium_automation-0.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file easy_selenium_automation-0.2.tar.gz.

File metadata

  • Download URL: easy_selenium_automation-0.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for easy_selenium_automation-0.2.tar.gz
Algorithm Hash digest
SHA256 523c961d94f2efbf591022e847ee6cf248f641a6884091a459f530a65712e5ab
MD5 4ecd24523ce2531ddcd27129c9577f88
BLAKE2b-256 4ee5e16ec4f95566311d3da90a3429e1e7e71f6d93726bb70f827206c9ebb8dd

See more details on using hashes here.

File details

Details for the file easy_selenium_automation-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_selenium_automation-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37f72656b24ef69dab36efcb48428a74e4cc4e0a455c987fdca9fe619afc8d1a
MD5 8cc54d5163865ff2b128b0c8e1a1922c
BLAKE2b-256 08c6b42a339d17888f0167c8e76078d709ae2c431e0df2c2f74b6c999aaa4bd9

See more details on using hashes here.

Supported by

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