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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_selenium_automation-0.3.tar.gz.
File metadata
- Download URL: easy_selenium_automation-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c05875ef8ad3573731bbc69d36c853619831b2ba3513ad84c765d9792dffdb9c
|
|
| MD5 |
bdc4f5d6fafdfe28945f112f4bbb34e4
|
|
| BLAKE2b-256 |
cb4877195e3dce8441ec732b9523b6eafdb9907b98d12aa8aa27a76b99f6c273
|
File details
Details for the file easy_selenium_automation-0.3-py3-none-any.whl.
File metadata
- Download URL: easy_selenium_automation-0.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7aa532397f04e34dd36fc1e3c63dafef7baafab7ca198cbaf269807bb3981aa
|
|
| MD5 |
f64767bc80dce409e0b441595bbcb90a
|
|
| BLAKE2b-256 |
7fafa946403020457dddc489f24ce7eb206156bfdab2d9da08d0dce7fe5c0bef
|