简体   繁体   English

硒时间执行测试

[英]Selenium time execution of test

My Selenium test clicks on some elements of a page and executes javascript. 我的Selenium测试单击页面的某些元素并执行javascript。 How can I time this entire workflow? 我如何计时整个工作流程? I am not testing the page load speed but rather how fast Selenium finishes execution of all the tasks I give it. 我不是在测试页面加载速度,而是在测试Selenium完成给我的所有任务的执行速度。 I am using Java. 我正在使用Java。

The easiest (and most thorough) out of the box solution is to use Selenide , which has a really nice (undocumented) feature that is able to give timings of page loads and components in a page. 最简单(也是最彻底)的开箱即用的解决方案是使用Selenide ,它具有一个非常好的(未记录的)功能,能够提供页面加载和页面中组件的计时。 But, you could add your own timer events to the Configuration methods of a JUnit or TestNG test. 但是,您可以将自己的计时器事件添加到JUnit或TestNG测试的Configuration方法中。 Take this page as an example: How can we get exact time to load a page using Selenium WebDriver? 以该页面为例: 如何获得使用Selenium WebDriver加载页面的准确时间?

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM