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

后端 未结 11 451
无人共我
无人共我 2020-12-10 17:19

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
相关标签:
11条回答
  • 2020-12-10 17:40

    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.

    0 讨论(0)
  • 2020-12-10 17:42

    IE 11 was running slow on a Windows 8.1 VM, I was running IEDriverServer.exe 3.5.1.0 (x32), I fixed by changing to IEDriverServer.exe 3.5.1.0 (x64). Note: 3.4.0.0 does not fix this issue. nativeEvents: false did not change anything. The driver is in my PATH, not sure what happens if it's not.

    0 讨论(0)
  • 2020-12-10 17:43

    I fixed it by downloading and using a 32bit one. The thread that helped me resolve

    https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5116

    0 讨论(0)
  • 2020-12-10 17:45

    Better Solution:

    Take note: I have reset all my IE settings before doing this solution, also in my first answer I was running a much older version of IE driver.

    1. Download the latest IE driver - I have downloaded version 3.4 32 bit (the 64 bit was still slow when I was testing it) http://selenium-release.storage.googleapis.com/index.html?path=3.4/

    2. You will need to change your IE settings 2.1 Go to Tools -> Internet Options -> Security. Set all zones to the same protected mode, enabled or disabled should not matter. Like this: http://seleniumquery.github.io/images/ie-driver-protected-mode-disable.png

    3. Now in you code add this:

      public static void runInternetExplorer() {
      
      System.setProperty("webdriver.ie.driver", "C:\\eclipse\\webdriver\\IE\\IEDriverServer.exe");
      
      WebDriver webDriver = new InternetExplorerDriver();
      new browser (webDriver);
      

      }

    When I run this, it run very nicely. I have left my previous answer if this solution isn't working.

    0 讨论(0)
  • 2020-12-10 17:48

    Release note v2.47.0.1:

    • Enabled fast failure for cookie manipulation in IE. The refactor of cookie handling for the IE driver introduces an incompatibility with the 64-bit IE driver and IE 10 and 11 running on 64-bit Windows. As is the case with sending keystrokes and creating screenshots, a Windows hook procedure is now used for getting and settingcookies in IE. That means that in IE 10 and 11 on 64-bit Windows, where the content rendering process is still 32-bit, you must use the 32-bit IEDriverServer.exe in order to manipulate cookies. This commit will now cause exceptions to be thrown if you attempt to set or get cookies using the 64-bit driver against a 32-bit version of IE (or vice versa), but in particular, this will affect users who mistakenly try to use the 64-bit executable with IE 10 or 11 in 64-bit Windows.

    (https://raw.githubusercontent.com/SeleniumHQ/selenium/master/cpp/iedriverserver/CHANGELOG)

    So you should use 32 bit or the content rendering needs to be changed to 64 bit

    0 讨论(0)
提交回复
热议问题