Python Selenium SDK for testing with Smart UI
Maintained. Last release 12 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install lambdatest-selenium-driverlambdatest-selenium-driver
SmartUI SDK for python selenium
Installation
Install Smart UI cli
$ npm install -g @lambdatest/smartui-cli
Install Python Selenium Package
$ pip3 install lambdatest-selenium-driver
Methods
smartui_snapshot(driver,"Snapshotname")
driver(required) - A Selenium driver instance is required.name(required) - Name of the screenshot
Usage
Example selenium test using smartui_snapshot
from lambdatest_selenium_driver import smartui_snapshot
from selenium import webdriver
driver = webdriver.Chrome()
try:
driver.get('https://www.pinterest.com/pin/16958936087791895/')
smartui_snapshot(driver,"Snapshotname")
except Exception as err:
print(err)
finally:
driver.close()
Copy the project token from SmartUI Dashboard and set on CLI via comman For Linux/macOS:
export PROJECT_TOKEN="****-****-****-************"
For Windows:
set PROJECT_TOKEN="****-****-****-************"
Running test
$ npx smartui exec [python test command]
This will create new build and upload snapshot to Smart UI Project.
Executing above test
$ npx smartui exec python test.py
✔ Authenticated with SmartUI
→ using project token '******#ihcjks'
✔ SmartUI started
→ listening on port 8080
✔ Fetched git information
→ branch: main, commit: 7e336e6, author: Sushobhit Dua
✔ SmartUI build created
→ build id: ee2cb6c5-9541-494a-9c75-a74629396b80
✔ Execution of 'python3 test.py' completed; exited with code 0
→ INFO:@lambdatest/python-selenium-driver:Snapshot captured name
✔ Finalized build