我想计算 Watir 或 Selenium 中的页面加载时间

2024-03-28

这是场景:



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}"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

我想计算 Watir 或 Selenium 中的页面加载时间 的相关文章

随机推荐