Dock-py-selenium

Latest version: v2.1.4

Safety actively analyzes 623412 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.1.1

DOCK SELENIUM

Python only

This is a startup directory to write the selenium scripts in python along with some customization.

Steps.
1. `pip install dock-py-selenium`
2. Create a `test.py` file in your root directory and write your test scripts.
3. Always bind any selenium script with the created instance.


Features

1. Setting a custom wait time for the webdriver `test_instance.wait(5)`
2. Settting the number of times a test should be performed `test_instance.rerun(3, lambda: run())`
3. Getting the title of the page `test_instance.getTitle()`
4. Checking whether the button or input type submit is clickable `test_instance.checkClick("button")` or `test_instance.checkClick("input")`
5. Checking the presence of an element in a webpage `test_instance.checkElement("CLASS_NAME","container")`


<mark> Note that, this project is still experimental and hence does not support the full render wait time for any test actions. </mark>


Example

from dock_py_selenium.dock.dock import Driver, options, Keys
from selenium import webdriver

driver = webdriver.Chrome(options=options)
dock_instance = Driver(driver)

Starting the dock instance
This step is compulsory
dock_instance.start()

Getting the title of the webpage
dock_instance.getTitle()

Checking whether an element with name = username is present
dock_instance.checkElement("name", "username")

Checking whether an element with name = fname is present & sending "John" as input
dock_instance.checkElement("name", "fname").send_keys("John")

Checking whether an element with name = login is present & then clicking the element
dock_instance.checkElement("name", "login").click()

Checking the title of the webpage
dock_instance.checkTitle("Dock Selenium")

2.0.1

2.0.0

Since this version, you can call test_instance.start() to input the URL through the command prompt.

1.0.3

This release contains very few features like getting the title, setting the driver wait time for synchronization & checking the presence of elements.

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.