Skip to content

Instantly share code, notes, and snippets.

@rpaskin
Created June 13, 2019 14:07
Show Gist options
  • Save rpaskin/d72d2e3a670dc4c875a0e8b153e98bb2 to your computer and use it in GitHub Desktop.
Save rpaskin/d72d2e3a670dc4c875a0e8b153e98bb2 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment