0

I want to measure the time of loading the page. I use watir-webdriver performance gem and this code:

5.times do
  @b.goto ("#{@host}")    
  puts "Load Time: #{@b.performance.summary[:response_time]/1000.000} seconds."
end

But now I need to produce yalm file, that collect the time information of the cucumber-test for my statistic.

Kurt Russell
  • 225
  • 1
  • 3
  • 15
  • Are you already getting the performance information you need? Are you just asking how to output to the yaml file? – Justin Ko Jan 09 '13 at 15:10

1 Answers1

2
def write_to_file(p)
  File.open('performance.txt', 'a') {|file| file.write("#{p} - #{@b.performance.summary[:response_time]/1000.000} seconds\n") }
end

@page = "google.com"
write_to_file(@page)
Kurt Russell
  • 225
  • 1
  • 3
  • 15