抱歉,没有找到类似的问题,也许有人可以提供帮助.
Sorry didn't find a similar question and maybe somebody can help.
由于其他要求,我们不仅必须使用Chrome来测试项目,还必须使用Firefox来测试我们的项目.当我们简单地将测试上下文更改为Firefox时,事实证明,所有findElement调用所花费的时间比Chrome所花费的时间多10倍.所有测试都完全毁了.我们尝试使用不同的测试机,但结果是相同的.该项目位于Core .Net上.为了进行测试,我们使用了MSTest V2,Firefox 63(64位)和Geckodriver 0.22(64位).
Due to additional requirements we have to test our project not only with Chrome but with Firefox as well. When we simply changed a test context to Firefox it turned out that all calls of findElement took 10 times more time than with Chrome. All tests are completely ruined. We tried to use different test machines but the results are the same. The project is on Core .Net. For testing we use MSTest V2, Firefox 63 (64 bit) and Geckodriver 0.22 (64 bit) .
非常感谢您的帮助.
推荐答案通过参考上一个答案,我的问题已通过以下代码解决.
By referring to the previous answer, my issue was solved by below code.
string geckoDriverDirectory = "Path of geckodriver.exe" FirefoxDriverService geckoService = FirefoxDriverService.CreateDefaultService(geckoDriverDirectory); geckoService.Host = "::1"; var firefoxOptions = new FirefoxOptions(); firefoxOptions.AcceptInsecureCertificates = true; Driver = new FirefoxDriver(geckoService, firefoxOptions);更多推荐
Selenium Geckodriver执行findElement的速度比chromedriver(.Net)慢10倍
发布评论