Load testing with RWebSpec

By mark
This is one of most asked questions on iTest: "Can it do load testing?". As more projects getting to acknowledge "Automated UI (functional) testing is not possible":http://blog.objectmentor.com/articles/2009/09/29/ruining-your-test-automation-strategy, Load testing gradually is becoming the replacement of 'Automated Testing', which is not right of course. Users of iTest will disagree this permissive view of functional testing, but that's not the topic today. Back to the question, our answer is "iTest is a functional test tool, but the functional test scripts created may be used for load testing, and work has started on creating a load testing IDE". What's special about it?
  1. Reuse functional test scripts

    Different from most current load testing scripts (which work on HTTP request levels), our loading test scripts use same syntax of functional test scripts: RWebSpec, which is known to be very readable. Furthermore, you can reuse the functional test scripts for load tests with only slight modifications.

  2. See load test scripts in action in Firefox browser

    Although execution of load tests is in headless mode, ie, seeing test running in a browser during development greatly improve the experience and confidence. Load tests with RWebSpec just allow you that.

  3. Can verify page contents just as functional testing.
The IDE is still under development, but you can try load tests using RWebSpec now (from command line). You need Java 1.6 installed first, see ReadMe.txt included 1. Download iLoad2 v0.1 here, 2. Unzip to C:\ to make application folder C:\iLoad2-01 3. Start a command window, enter the following command to add application to PATH.
    C:\>cd iLoad2-0.1
C:\iLoad2-0.1>SET PATH=C:\iLoad2-0.1\bin;%PATH%
  
4. (Optional) Preview load testing run in Firefox browser ("install JSSH plugin":http://TestWise.com/documentation/firefox-support first)
    spec -fs samples\agile_travel\deny_access_preview_rwebspec.rb
  
5. Run load tests with a number of virtual users.
    spec -fs samples\agile_travel\deny_access_rwebspec.rb
  
The output shows how long does it take for each virtual user:
    Thread[1] 6.861s
  Thread[3] 7.455s
  Thread[2] 7.674s
  Thread[4] 9.456s
  
Now let's example the actual load test scripts:
    run_with_virtual_users(4) {
  browser = open_browser("http://travel.agileway.net", {:resynchronize : false})
  home_page = HomePage.new(browser) # We cam reuse page objects!
  home_page.click_sign_in
  assert browser.text.include?("You did not provide any details for authentication.")
}