Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
356 views
in Technique[技术] by (71.8m points)

c# - Why is Selenium InternetExplorerDriver Webdriver very slow in debug mode (visual studio 2010 and IE9)

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)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...