Skip to content

Instantly share code, notes, and snippets.

@omaciel
Last active December 28, 2015 22:09
Show Gist options
  • Save omaciel/7569869 to your computer and use it in GitHub Desktop.
Save omaciel/7569869 to your computer and use it in GitHub Desktop.
Moving around Foreman's menus
import lib.ui.login
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
browser = webdriver.Firefox()
browser.get("https://qetello01.usersys.redhat.com")
login = lib.ui.login.Login(browser)
login.login('admin', 'changeme')
# Click the More menu
browser.find_element_by_xpath("//div[contains(@style, 'static')]//a[@id='more']").click()
# Find the Configuration menu and move the mouse over it
el = browser.find_element_by_xpath("//div[contains(@style, 'static')]//a[@id='configuration']")
ActionChains(browser).move_to_element(el).perform()
# Find the Environments menu, move the mouse over it and then click it
el = browser.find_element_by_xpath("//div[contains(@style, 'static')]//li[@id='environments']/a")
ActionChains(browser).move_to_element(el).perform()
el.click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment