Skip to content

Instantly share code, notes, and snippets.

@joey-g
Created February 20, 2015 16:46
Show Gist options
  • Save joey-g/26ad1dea07a2e4ccf7c1 to your computer and use it in GitHub Desktop.
Save joey-g/26ad1dea07a2e4ccf7c1 to your computer and use it in GitHub Desktop.
Automation Training Week 3
# WebDriver API Examples
driver = WebDriver.new('Chrome')
# Example of sending keystrokes to an input field.
input_el = driver.find_element(<some_input_selector_goes_here>) # <-- Returns an instance of the WebElement class.
input_el.send_keys('Hey') # <-- Sends keystrokes to the retrieved input WebElement object.
# Example of clicking a button.
button_el = driver.find_element(<some_button_selector_goes_here>) # <-- Returns an instance of the WebElement class.
button_el.click() # <-- Clicks the retrieved button WebElement object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment