devops:selenium
Table of Contents
Selenium
Prerequirements
- Python
- Python selenium plugin, installed via
pip install selenium
Recording
To record the cases use chrome plugin: “Katalon Recorder (Selenium IDE for Chrome)”
Download the chromedriver: http://chromedriver.storage.googleapis.com/index.html And use it within the script
Here is a demo script:
from selenium import webdriver chromedriver = "..//ChromeWebDriver//chromedriver.exe" driver = webdriver.Chrome(chromedriver) driver.get("http://localhost:8080") assert "Frontend" in driver.title elem = driver.set_window_size(1800,800) driver.find_element_by_id("menu-about").click(); elem = driver.save_screenshot('screen1.png') driver.quit()
Execute
Now you can just execute the python test from the console, where python is available. Chrome will be started. The test will be executed.
devops/selenium.txt · Last modified: by skipidar