为什么Selenium InternetExplorerDriver Webdriver在调试模式下会非常慢(Visual Studio 2010和IE9) [英] Why is Selenium InternetExplorerDriver Webdriver very slow in debug mode (visual studio 2010 and IE9)

查看:101
本文介绍了为什么Selenium InternetExplorerDriver Webdriver在调试模式下会非常慢(Visual Studio 2010和IE9)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SeleniumHq网站上的示例代码-但在调试模式下,性能却很糟糕。

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

在发布模式下,整个测试大约需要6秒钟(包括启动和关闭IE)
在调试模式下需要65秒?

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

示例代码仅为:

    [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();

    }

我在ie8中尝试过,并且具有相同的性能。 Firefox很好-但是我的客户使用IE,所以我一直坚持对其进行测试。另外-如果使用Selenium RC,我不会遇到相同的问题。

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-我使用的是.Net 4和最新版本(2.16)的webDriver .dll(在64位Windows 7框上运行)

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

推荐答案

对我来说,解决方法是切换到32位版本的来自 https:/的 InternetExplorerDriver.exe /code.google.com/p/selenium/downloads/list

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

如今似乎是 IEDriverServer ,但仅将其重命名为 InternetExplorerDriver.exe 即可。

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

这篇关于为什么Selenium InternetExplorerDriver Webdriver在调试模式下会非常慢(Visual Studio 2010和IE9)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆