Answer the question
In order to leave comments, you need to log in
How to speed up typing in Internet Explorer (IE) 11 in Selenium tests?
Good day!
While running the basic test (login) I encountered an unexpected problem on IE 11: very slow text entry in input fields.
Windows 10 x64,
IE 11,
Pytest,
Selenium 3.141
Tried using both x32 and x64 driver binaries. In the settings of IE itself, the checkbox for compatibility with 64-bit processes is checked. Tried to disable native events - 0 sense. I have to use duct tape as ctrl+c / ctrl+v.
Maybe there is some kind of workaround?
Answer the question
In order to leave comments, you need to log in
So, the problem resolved itself when the tests were run on a VM with 32-bit Windows and a 32-bit IEDriverServer binary
Use JS and browser.execute_script
You can peep the function to insert in Selenide
browser.execute_script(s"return (function(webelement, text) {" +
"if (webelement.getAttribute('readonly') != undefined) return 'Cannot change value of readonly element';" +
"if (webelement.getAttribute('disabled') != undefined) return 'Cannot change value of disabled element';" +
"webelement.focus();" +
"var maxlength = webelement.getAttribute('maxlength') == null ? -1 : parseInt(webelement.getAttribute('maxlength'));" +
"webelement.value = " +
"maxlength == -1 ? text " +
": text.length <= maxlength ? text " +
": text.substring(0, maxlength);" +
"return null;" +
"})(arguments[0], arguments[1]);", element, text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question