Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用watir webdriver性能获取Ajax性能数据_Ajax_Performance_Watir Webdriver_Performance Testing - Fatal编程技术网

如何使用watir webdriver性能获取Ajax性能数据

如何使用watir webdriver性能获取Ajax性能数据,ajax,performance,watir-webdriver,performance-testing,Ajax,Performance,Watir Webdriver,Performance Testing,如何使用watir webdriver性能获取Ajax性能数据 当我使用下面的脚本时,我在触发Ajax请求后得到了相同的结果 require 'rubygems' gem "selenium-webdriver" require 'watir-webdriver' require 'watir-webdriver-performance' Selenium::WebDriver::Chrome.path = chromePath b = Watir::Browser.new :chrome

如何使用watir webdriver性能获取Ajax性能数据

当我使用下面的脚本时,我在触发Ajax请求后得到了相同的结果

require 'rubygems'
gem "selenium-webdriver"
require 'watir-webdriver'
require 'watir-webdriver-performance'

Selenium::WebDriver::Chrome.path = chromePath
b = Watir::Browser.new :chrome

b.goto 'Ajax Website'
p b.performance.summary

# click some ajax button to trigger server request 
p b.performance.summary

# click some ajax button to trigger server request 
p b.performance.summary

b.close
输出

{:time_to_first_byte=>396, :request=>395, :tcp_connection=>0, :app_cache=>0, :time_to_last_byte=>405, :redirect=>679, :response=>9, :dns=>0, :response_time=>6134, :dom_processing=>4041}

{:time_to_first_byte=>449, :request=>446, :tcp_connection=>0, :app_cache=>0, :time_to_last_byte=>458, :redirect=>2320, :response=>9, :dns=>0, :response_time=>3751, :dom_processing=>946}

{:time_to_first_byte=>449, :request=>446, :tcp_connection=>0, :app_cache=>0, :time_to_last_byte=>458, :redirect=>2320, :response=>9, :dns=>0, :response_time=>3751, :dom_processing=>946}

我确实在页面上用Ajax触发了一些对服务器的请求。