Created
June 15, 2018 10:03
-
-
Save emanlove/e9fc771fdc34b7b076dd262829725a15 to your computer and use it in GitHub Desktop.
Debug scripts to determine where the issue is when IE / Robot Framework / Selenium / Web Application translates ~O as Ö
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
<html> | |
<head></head> | |
<body> | |
<form> | |
<input id="editbox" type="text" /> | |
</form> | |
</body> | |
</html> |
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
from selenium import webdriver | |
str1 = """i,G|79UAFg$z070X`6r_|0W4T:0Hzx_A73rnClqL~OK]xi~$oN""" | |
str2 = """dPs"[G=dKat4}~\'h,I|j&`<UC\\nOaOJo!<qB!<=;7*^5G@bh""" | |
str3 = """G^vktSzD'o&wxd3=)g(yqM|w#SVD^6b/:ZGAlC/9{<\\~w]:A[O""" | |
strs = [str1, str2, str3] | |
driver=webdriver.Ie() | |
driver.get('file:///D:\Projects\IEJavascriptStr\BasicForm.html') | |
for thisstr in strs: | |
el=driver.find_element_by_id('editbox') | |
el.clear() | |
el.send_keys(thisstr) | |
value = el.get_attribute('value') | |
if value == thisstr: | |
print('match') | |
del value | |
el.clear() | |
driver.execute_script("document.getElementById('editbox').value = arguments[0]",thisstr) | |
value = el.get_attribute('value') | |
if value == thisstr: | |
print('match') | |
del value | |
el.clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment