Skip to content

Instantly share code, notes, and snippets.

@tonetheman
Created July 18, 2014 13:16
Show Gist options
  • Select an option

  • Save tonetheman/2c95b324d3a9bc9fcd9f to your computer and use it in GitHub Desktop.

Select an option

Save tonetheman/2c95b324d3a9bc9fcd9f to your computer and use it in GitHub Desktop.
selenium-example-1 to show how to use driver find element and python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.send_keys("selenium")
elem.send_keys(Keys.RETURN)
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment