Monthly Archives: August 2010

Automatic testing for me, above all, means: ‘peace of mind’. After you do development work or code maintenance of a web page, you easily can verify that things works as expected, which is a wonderfull experience.

I only do functional testing, time constraints prevent me from doing TDD or achieve ample test code coverage. Functional testing means that in a short time I can warranty the software works as it did before or that the new functionality is acomplished.

What Does This Post Is About

This article describes how to automatically generate user interactions like filling text, number fields, textboxes, selecting values and clicking on elements in MS IE (Microsoft Internet Explorer browser*) and logging in a file the result, confirming that the app complies with expected results or where it fails.

The main focus is on web pages using the dojo toolkit framework 1.5.

* These tools are reported to work with firefox and safari, check watir installation. If You are using linux check this blog. [Edit: or check this for firefox and chrome]

Look at the name attribute and the type of field, you filled the first two and clicked the third with Ruby.

The best way to see the code is to install firefox add-in firebug and use the context menu (right mouse button over the page object) and select inspect element.

We’ll see what happens with the HTML after the dojo.toolkit renders its elements that are called widgets. Our test form looks like this (is a modified version from the file that you downloaded ./digit/tests/form/Form.html):

So well wait a little and then test for text that should be in the answer. It could be a valid answer or the warning of an error. If the text is found the script continues until the end is reached and a sumary like this one is shown.