有没有办法在Selenium中减慢Firefox的执行速度?

huangapple 未分类评论69阅读模式
英文:

Is there a way to slow down firefox execution speed in selenium?

问题

我正在开发一个针对基于Angular的Web应用程序的Selenium / Java框架。我必须在Chrome、Edge和Firefox浏览器上运行我的测试。对于Chrome和Edge,测试执行过程中没有任何问题。但是,Firefox浏览器每次运行都非常快。

那么,有没有关于控制Firefox执行速度的具体想法?还是我们总是需要开发一个带有特定于浏览器的代码的框架?请分享您的想法。

Selenium版本:3.141.59

英文:

I'm developing a new selenium / java framework for angular based web application. I have to run my tests across Chrome, Edge and Firefox. For Chrome & edge there are no issues at all during test execution. But, the firefox browser runs very fast everytime.

So, is there any specific idea on controlling the firefox execution speed? (OR) do we always need to develop a framework with browser specific code? Please share your ideas.

Selenium version: 3.141.59

答案1

得分: 0

你是否在使用 Protractor?- protractortest.org - Protractor 是为 Angular 应用程序设计的,并包含了额外的同步方法。它扩展了 WebDriver 框架,因此您所做的不需要重新启动。

从该网站摘录:

> 自动等待
>
> 您不再需要在测试中添加等待和休眠。Protractor 可以在网页完成待处理任务后自动执行下一步,因此您不必担心等待测试和网页同步。

我在 C# 中使用它取得了相当不错的成功。

英文:

Are you using protractor? - protractortest.org - protractor is designed for angular applications and includes an additional sync methods. It extends the webdriver framework so what you've done doesn't need to be restarted.

Taken from the site:

> Automatic Waiting
>
> You no longer need to add waits and sleeps to your
> test. Protractor can automatically execute the next step in your test
> the moment the webpage finishes pending tasks, so you don’t have to
> worry about waiting for your test and webpage to sync.

I've used it in c# with reasonably good success.

huangapple
  • 本文由 发表于 2020年8月14日 22:07:17
  • 转载请务必保留本文链接:https://java.coder-hub.com/63414371.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定