AJAX testing in iTest2

Posted by Zhimin Zhan on December 29, 2009|Comments|Read full article

Web 2.0 sites such as GMail grow rapidly, which brings big challenges to web test automation. Different from traditional web sites with “synchronous request/response model”, new web sites handle requests asynchronously using AJAX. For example, in GMail, clicking ‘Send’ button does not land you on ‘Email Sent’ page, instead you see a ‘Sending…’ banner appears and replaced with ‘Email sent successfully’ later. The difficulty of testing AJAX web sites are not knowing when the request is processed and verify dynamic updated page contents.

The approach used iTest2 is simple, after AJAX call, keep trying next operation with specific time. During that time frame, operation error will be ignored (and try again after interval),

    button(:value,"Transfer").click
    # try up to 10 seconds, waiting receipt date 'showing up'
    try(10) { label_with_id("date").should == today }

    # try up to 60 seconds every 10 seconds.
    try (60, 10) { click_button('Next') }

To assert specific HTML element is shown or hidden

    assert_hidden(:div, "info")  # <div id='info'>...</div> is hidden
    assert_visible(:div, "info")

To assert specific HTMl element is added or removed in a web page


assert_exists(“label”, “email_sent”) #

False positive virus alert on TestWise.exe

Posted by Zhimin Zhan on December 08, 2009|Comments|Read full article

We use free Bat to Exe Converter to create an exe file (with icon) to launch TestWise. Unfortunately, a few Anti-Virus software reported false positive on it, please be assured that TestWise is virus free.

Virus Total, an online virus scanning service, reports 5 out of 41 Ant-Virus software detect TestWise positive, they are Comodo, Jiangmin, McAfee+Artemis, McAfee-GW-Edition and TrendMicro.

If you happen to have tho annoyance, you can try to start TestWise with batch file included.

If you are interested in why exe file generated by “Bat to Exe Converter” may cause false virus alert, please read this.


Load testing with RWebSpec

Posted by Zhimin Zhan on December 02, 2009|Comments|Read full article

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, 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. Preview load testing run in Firefox browser (install JSSH plugin 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:

  Thread1 6.861s
Thread3 7.455s
Thread2 7.674s
Thread4 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.")
}