Skip to main content

Posts

Showing posts with the label watir

Integration of your test suite with Hudson using Apache Ant

The quick, dirty and painless guide to integrate your test automation suite with Hudson. Prerequisites 1. It is assumed that you already have test automation suite that produces test results in JUnit XML format. For example this can be a bundle of Selenium RC and JUnit. Or Watir and Cucumber with JUnit-style reporter. 2. You need to create Ant project build.xml script that executes your test suite. Materials: http://varun-qa.blogspot.com/2010/03/ant-script-for-generating-junit-report.html Example (execution of Watir/Cucumber test suite on Windows): 3. It is assumed that your test automation suite is stored to Subversion or CVS server. 4. Download hudson.war from here: http://hudson-ci.org/latest/hudson.war Steps 1. Go to the directory with downloaded hudson.war and run the following command: java -jar hudson.war 2. Open your browser and go to: http://localhost:8080/ 3. Click "New Job" link on the left panel of Hudson dashboard 4. Enter job name (this can be any

Watir test automation framework and AJAX

It is more challenging to implement automated tests for websites using dynamic AJAX requests which load data or elements on the fly. With Watir test automation framework there are several different approaches. We can insert some fixed sleeps before the checkpoints. However this is a bad solution in many cases because quite often we don't know the exact time it takes, also fixed sleeps can make our tests very slow, especially when we have a large test automation suite. This is my solution for Watir test automation framework. It retries any operation with the element until success. If it fails for the first time, it retries again in 3 seconds, repeating 5 times until success. We can configure the maximum number of retries and the interval between each retry. Implementation of the method in Ruby Usage examples