2013-03-19 61 views
1

我需要通过测量点击导航应用加载时间做性能测试。我使用了Watir-webdriver性能的宝石。它适用于Chrome并且不支持Firefox。请让我知道如何在Firefox上做到这一点的指导?如何衡量的Watir-webdriver的加载时间为Firefox

谢谢

+0

关闭我的头顶,我要么看到镀铬应该并添加了对Firefox的支持,或者写一个页面加载功能到你的框架来衡量它。 – 2013-03-20 00:50:32

回答

0

我有同样的问题,以及之前我发现有关性能的宝石。

我发现只有出现一个元素时负载动作完成

,等待它是可用的:

browser.element.present? 

林意识到它的一个非常粗略的解决方法,但是这是唯一的事情我想到了。 它给你一个关于行动时间的粗略估计。

2

这是我要做的事:

require 'watir-webdriver-performance' 

$response = $browser.performance.summary[:response_time] 
$first_byte = $browser.performance.summary[:time_to_first_byte] 
$last_byte = $browser.performance.summary[:time_to_last_byte] 

def performance_check 
    puts ("#{$browser.url}: Response time: #{$response}ms.") 

    puts ("#{$browser.url}: Time to first byte: #{$first_byte}ms.") 

    puts ("#{$browser.url}: Time to last byte: #{$last_byte}ms.") 
end 

def test_site_01 
    $browser.goto("http://www.google.com/") 
    performance_check 
end 

见我对的Watir-webdriver的性能宝石的问题。宝石的开发人员会根据第一个/最后一个和响应时间之间的差异做出响应。

What is the difference between :response_time, :time_to_first_byte, and :time_to_last_byte in watir-webdriver-performance gem?