Skip to content

Instantly share code, notes, and snippets.

@karlosmid
Created December 19, 2015 16:10
Show Gist options
  • Save karlosmid/b9ab71ed2b8488b0abe7 to your computer and use it in GitHub Desktop.
Save karlosmid/b9ab71ed2b8488b0abe7 to your computer and use it in GitHub Desktop.
Send ampersand in selenium webdriver
def send_keys_filtered(text, locator)
text.split('').each do |character|
if SHIFT_KEYS.has_key? character
@driver.action.key_down(:shift).send_keys(SHIFT_KEYS[character]).key_up(:shift).perform
else
find(locator).send_keys(character)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment