20

I'm using the example code from the SeleniumHq site - but in debug mode the performance is awful.

In release mode the entire test takes about 6 seconds (including launching and closing IE) In Debug mode it takes 65 seconds ?

The sample code is just :

    [Test]
    public void testBrowser()
    {
        // Do something here
        IWebDriver driver = new InternetExplorerDriver();
        //Notice navigation is slightly different than the Java version
        //This is because 'get' is a keyword in C#
        driver.Navigate().GoToUrl("http://www.google.com");
        IWebElement query = driver.FindElement(By.Name("q"));
        query.SendKeys("Cheese");
        System.Console.WriteLine("Page title is: " + driver.Title);
        // TODO add wait
        driver.Quit();

    }

I've tried it in ie8 and have the same performance. Firefox is fine - but my clients use IE so I'm stuck with testing against it. Also - I don't have the same issues if I use Selenium RC.

NB - I'm using .Net 4 and the latest version (2.16) of the webDriver.dll (running on a 64bit windows 7 box)

Jon Spokes
  • 2,599
  • 2
  • 18
  • 21
  • It seems to be related to running it in x64 mode? When I force it to run in x86 debug mode the performance is fine ? – Jon Spokes Jan 17 '12 at 13:23
  • 2
    Same question but more details from the Selenium team at : http://groups.google.com/group/selenium-users/browse_thread/thread/4543181e60251841/65eaeab241c7ff8a?lnk=raot&pli=1 – Jon Spokes Jan 18 '12 at 20:55
  • I'm having the same problem with 32bit and 64bit versions of InternetExplorerDriver. And I noted that iexplorer.exe process get about 30% to 60% of my CPU while is executing the tests, with long pause between some operations. – Luciano Jan 18 '13 at 18:13
  • I recently got a new machine, but after setting it up with all the same software, I no longer get the issue. in 32 or 64. So I can't test the problem anymore, never mind. – Jon Spokes Mar 21 '13 at 21:09
  • I still have this problem in Win7 x64, and in several VMs also with Win7 x64. I cannot test in others OS and/or in x86 (32bits), yet. In all them IE9. – Luciano Mar 22 '13 at 14:12

3 Answers3

27

For me, the fix was to switch to the 32 bit version of InternetExplorerDriver.exe from https://code.google.com/p/selenium/downloads/list

Seemingly named IEDriverServer nowadays, but works if you just rename it to InternetExplorerDriver.exe.

dur
  • 15,689
  • 25
  • 79
  • 125
slavikko
  • 346
  • 4
  • 4
  • 1
    This doesn't appear to be working for me a year later, Win 7 x64 with IE 9 x32, both versions of IEDriverServer.exe will result in very slow operation. – Cellivar Sep 02 '14 at 14:15
  • This solution worked for me as of selenium version 2.52 (Feb 2016) – Chris Feb 15 '16 at 20:24
12

check 'prefer 32 bit' is not checked in your build properties. If it is and you are using the 64 bit IE driver it will run like an asthmatic snail.

Jules
  • 1,071
  • 2
  • 18
  • 37
2

Using the C#, NUnit, C# webdriver client and IEDriverServer, I originally had the problem with slow input (e.g., sending keys to an input box would take about 5 seconds between keys, or clicking on a button same kind of delay).

Then, after reading this thread, I switched to the 32-bit IEDriverServer, and that seemed to solve the problem.

But today I was experimenting with the InternetExplorerOptions object in order to set some options on IE according to this documentation:

https://code.google.com/p/selenium/wiki/InternetExplorerDriver

Per the documentation, I created the registry value HKCU\Software\Microsoft\Internet Explorer\Main\TabProcGrowth with a value of 0 in order to use ForceCreateProcessApi = true and BrowserCommandLineArguments = "-private."

After doing this, I noticed that the slow-input problem was back. I had made several changes to my code, but after rolling all of them back, the problem still persisted. When I removed the aforementioned registry key, however, the input was back to full speed (no delay).

domehead100
  • 161
  • 1
  • 7