devops:selenium
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| devops:selenium [2023/11/01 07:15] – removed - external edit (Unknown date) 127.0.0.1 | devops:selenium [2023/11/01 07:15] (current) – ↷ Page moved from camunda:devops:selenium to devops:selenium skipidar | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Selenium ===== | ||
| + | ==Prerequirements== | ||
| + | * Python | ||
| + | * Python selenium plugin, installed via | ||
| + | < | ||
| + | pip install selenium | ||
| + | </ | ||
| + | |||
| + | == Recording== | ||
| + | |||
| + | To record the cases use chrome plugin: " | ||
| + | |||
| + | |||
| + | |||
| + | Download the chromedriver: | ||
| + | And use it within the script | ||
| + | |||
| + | |||
| + | Here is a demo script: | ||
| + | <sxh python> | ||
| + | from selenium import webdriver | ||
| + | chromedriver = " | ||
| + | driver = webdriver.Chrome(chromedriver) | ||
| + | driver.get(" | ||
| + | assert " | ||
| + | |||
| + | elem = driver.set_window_size(1800, | ||
| + | |||
| + | driver.find_element_by_id(" | ||
| + | |||
| + | elem = driver.save_screenshot(' | ||
| + | |||
| + | |||
| + | 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. | ||
