Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix the slow sendkeys on IE 11 with Selenium Webdriver 3.0.0?

Firefox and chrome is working fine but with IE 11, the sendkeys are extremely slow. How do you fix this issue ?

My Environment:

  • Running IE 11.103
  • Operating System Windows 10
  • I'm using eclipse(Version: Neon Release (4.6.0)) with java 1.8
  • selenium Webdriver 3.0.0
like image 341
Shaun Cromie Avatar asked Nov 16 '16 08:11

Shaun Cromie


2 Answers

In my environment: WIN 10, selenium 3.4, IE64 I set: Internet Options → Advanced → Security → ☑ Enable 64-bit processes for Enhanced Protected Mode

like image 117
Miś Koala Avatar answered Oct 07 '22 05:10

Miś Koala


After a lot of reading online and experimenting

  1. I had to set my path to point to my web-driver Right Click on my Computer , then select "Advanced system settings", then click "Environment Variables", then select "Path" and click on edit. Now add the path to your IEDriverServer.exe, for example mine was "C:\eclipse\webdriver\IEDriverServer.exe". I would recommend restart your pc

  2. You must run the 32 bit IE WEB driver http://selenium-release.storage.googleapis.com/index.html I downloaded 3.0

  3. Now here is the piece of gold part that made the world of a difference to me. Set your IE to run as administrator. Right click on IE shortcut and select options, under Shortcut tab click on advanced button then check checkbox "run as administrator". Now Restart IE

  4. When you open IE , then go to tools, then Internet options and then security tab. I have unchecked "Enable Protected Mode" on Local intranet and trusted sites. Restart IE

  5. I used the following Desired Capabilities(I found this on the internet)

        DesiredCapabilities dc = new DesiredCapabilities();
    dc.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,false);
    dc.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, false);
    dc.setCapability(InternetExplorerDriver.UNEXPECTED_ALERT_BEHAVIOR, true);
    dc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    dc.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); 
    dc.setJavascriptEnabled(true);  
    
    WebDriver driver = new InternetExplorerDriver(dc);
    

This worked in my environment please post what has worked for you


Take note: After this I was experimenting with the 64 bit driver. If I made the (InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true), then it works sort off. In junit the assertion fails but I was able to use send key on the first page.

like image 25
Shaun Cromie Avatar answered Oct 07 '22 05:10

Shaun Cromie