performance - 我想用 Watir 或 Selenium 计算页面加载时间

标签 performance selenium watir

场景如下:

1. Login to a web application with username and password and hit Enter (Start timer)
2. Load the login page (lap timer split, to mark the time for page load )
3. Click on a another page (split the lap timer)
4. Stop the stop watch

最佳答案

Watir 中的任何方法调用都会返回所需的时间,因此这是一项微不足道的任务。

例如,

b.text_field(:id, 'uid').set username
b.text_field(:id, 'pwd').set password
time1 = b.button(:id, 'logon').click
time2 = b.button(:id,  'movepage').click
puts "Time One: #{time1} Time Two: #{time2} Total Time: #{time1+time2}"

关于performance - 我想用 Watir 或 Selenium 计算页面加载时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4177070/

相关文章:

ruby - safariwatir:如何选择匿名按钮

image - 为什么 Google PageSpeed 提示 Retina 图像?

python - 有效地生成所有可能的4人团队组合,其中包含130个角色中的特定角色并计算某些值

performance - 为什么 Lua 中的本地化函数更快?

python - 为什么多个 list.count 调用比单个循环更快?

java - 当我在 Java 中运行代码时,"verifyTextPresent"给出了错误的结果

javascript - 如何使用selenium Webdriver获取gmail的密码输入字段ID?

iphone - 可以使用Watir在移动设备上自动化移动站点测试吗?

c# - 在 selenium 和 c# 中移动物理鼠标指针

Watir- 如何将鼠标悬停在任何 HTML 元素上