【发布时间】:2016-01-09 18:46:36
【问题描述】:
我们使用 selenium webdriver dll 设置来运行我的自动化套件。仅在 Firefox 中运行测试时遇到此问题。 Firefox 中的测试运行速度非常慢,加载页面需要 3-4 分钟,但是,当我手动使用 Firefox 浏览器在同一台机器上运行相同的测试时,我没有遇到这种缓慢。有时在 Firefox 上运行自动化时,我们还会看到“连接已重置”页面。此外,相同的测试在 Chrome 和 IE 中运行良好。
我们使用以下环境:
Firefox 版本 28、37(代理设置为使用系统设置)
Webdriver (dlls) 2.45 版
Windows 7
之前我们使用 Firefox 版本 14,16 和 Webdriver 版本 2.37 在 Windows XP 中运行相同的设置,我们没有遇到此问题。
我们使用以下代码调用 Firefox:
Proxy proxy = new Proxy();
proxy.Kind = ProxyKind.System;
FirefoxProfile profile = new FirefoxProfile();
profile.SetProxyPreferences(proxy);
RemoteWebDriver dr = new FirefoxDriver(new FirefoxBinary(@"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"), profile, TimeSpan.FromSeconds(120));
dr.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3));
dr.Manage().Window.Maximize();
dr.Manage().Cookies.DeleteAllCookies();
dr.Navigate().GoToUrl(WebSiteUrl);
剩余的测试步骤......
请有人帮我解决这个问题。
提前致谢。
【问题讨论】:
-
这个问题解决了吗?我在 chrome 上遇到了同样的问题。
标签: selenium windows-7 selenium-firefoxdriver