Created
May 16, 2015 13:05
-
-
Save bjelline/70d18b20f2ac7aee3f4b to your computer and use it in GitHub Desktop.
simplest selenium test with python and chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
driver = webdriver.Chrome() | |
driver.get("http://localhost:5000/mood") | |
assert "Test App" in driver.title | |
el = driver.find_element_by_id('save') | |
el.click() | |
body = driver.find_element_by_xpath('//body') | |
assert 'saved to the database' in body.text | |
driver.close() | |
print "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment