Created
December 19, 2015 16:10
-
-
Save karlosmid/b9ab71ed2b8488b0abe7 to your computer and use it in GitHub Desktop.
Send ampersand in selenium webdriver
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
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