Quick Example

What can Madcow do for you? Check out the quick example below.



Your very first Madcow test

Open your favourite text editor and add the following:

invokeUrl = http://www.google.com.au/
google_searchBox.value = madcow test automation
google_searchButton.clickLink
waitSeconds = 1
verifyText = <em>Test automation</em> for the rest of us.

then save the file into the Madcow 2.0 tests folder as GoogleTest.grass.

Now create a new file with the following:

#Google Search
searchBox.name=q
searchButton.name=btnG

and save the file into the Madcow 2.0 mappings folder as google.grass.

Then open up a command prompt or terminal window on Mac and type…

./runMadcow.sh -t GoogleTest 

You should see a lot of things start to happen. Don’t worry this is just your test running.

It is running the above GoogleTest.grass file, which will basically do the following steps:

Note: Each one of those steps listed here directly correlates to the step in the testcase.

Once completed you will then want to see the results of your test. To do this simply open the index.html file in the results\madcow-results folder in your browser of choice.
or run at the command line in Mac

open results\madcow-results\index.html 

or in Windows

results\madcow-results\index.html 

It should look similar to this:

Test Suite Results page

Here you can see that it all passed successfully. To see further details about the test run click on the “GoogleTest” link and you should see more details step-by-step results showing what the Madcow test did.

GoogleTest Results


Whoa!

Want to know more about how that all worked?

Check out Writing Tests for more informaiton.