User Tools

Site Tools


devops:selenium

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
devops:selenium [2023/11/01 07:15] – removed - external edit (Unknown date) 127.0.0.1devops: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
 +<code>
 +pip install selenium
 +</code>
 +
 +== 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:
 +<sxh python>
 +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()
 +</sxh>
 +
 +== 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.