Watir has this very powerful, but I think, little understood feature, which I 
called an error checker.

You can create some code that gets called on each page load, kind of like this 
( I dont have time to test this right now though )

down_load_timer = Proc.new(){ |ie|

 log_to_file "Page Title: #{ie.title} Url #{ie.url}          download time 
#{ie.downloadtime}"
}

def log_to_file( log_me )
    # write code that writes the string log_me to a file
end

ie = Watir::ie.start("http://www.google.com";)

the log_to_file method will now get called every time a new page download 
happens

Ive used this extensively and it seems to work well
Apologies if the example above has some errors but Im busy, and am not on 
Windows at the moment)

Yes.  What I do is write out to a file page load times before and after application changes.  I have to rename the output file between runs. It is pretty simplistic but need some down and dirty perf numbers.

 

require 'date'

 

def test_myPerfTestCase

  $start = DateTime.now

 

  <code here>

 

  $stop = DateTime.now

   

  diff = $stop - $start

  h,m,s,frac = Date.day_fraction_to_time(diff)

  s += frac.to_f

  File.open('C:\watir_bonus\working\RAPID\pageSearchLoad_Times.txt', 'a+'){|d| d.puts "Time to load page:  " + "#{h} Hours, #{m} Minutes, #{s} Seconds"}

end   

 

--Mark

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Danny R. Faught
Sent: Wednesday, September 13, 2006 3:02 PM
To: [email protected]
Subject: [Wtr-general] using Watir for single-user performance testing

 

I briefly mentioned how I've been using Watir in a blog post today - "The Jury’s Still Out on OpenSTA" (http://tejasconsulting.com/blog/?p=74).

 

I'd be glad to elaborate on Watir's role in the toolchain, and discuss the necessity of using a browser-based test tool for single-user performance testing rather than a load test tool that does browser simulation.  I'm testing a web application that uses _javascript_ heavily, so measuring the impact of the _javascript_ execution time is important.  I was using Ruby and Squid to get low-level single-user inter-page timings, which a Perl script then used to edit the OpenSTA SCL code.

 

Is anyone else using Watir for performance testing?

--

Danny R. Faught

Tejas Software Consulting

http://tejasconsulting.com/

_______________________________________________

Wtr-general mailing list

[email protected]

http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to