Selenium Geckodriver执行findElement的速度比chromedriver(.Net)慢10倍

编程入门 行业动态 更新时间:2024-10-27 16:28:53
本文介绍了Selenium Geckodriver执行findElement的速度比chromedriver(.Net)慢10倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

抱歉,没有找到类似的问题,也许有人可以提供帮助.

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倍

本文发布于:2023-10-18 11:39:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504124.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:速度   findElement   Geckodriver   Selenium   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!