Skip to content

Instantly share code, notes, and snippets.

@emanlove
Created June 15, 2018 10:03
Show Gist options
  • Save emanlove/e9fc771fdc34b7b076dd262829725a15 to your computer and use it in GitHub Desktop.
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 Ö
<html>
<head></head>
<body>
<form>
<input id="editbox" type="text" />
</form>
</body>
</html>
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