Posted by admin on April 6th, 2011
Along with the big list of protocols you can monitor using the WatchMouse service and its global infrastructure, you can also execute “transaction application” tests or as they are more commonly referred to, “functional” tests.
Before going through the steps on how to create and upload such a script to your WatchMouse account, lets briefly see what transaction application testing actually is.
Transaction Application Testing
On top of testing the availability and the performance of a website or web application (non-functional testing), you can also test the individual components of it such as, a login procedure, the results of a search in a form, an article submission and so on.
Transaction application testing differs from non-functional system testing in that, with transaction application testing you have to specify and test the functions that the web service is expected to perform.
Creating a transaction testing script
WatchMouse uses the JMeter scripting engine to run transaction application tests. A JMeter script is like a browser which executes steps that test the functionality of a web application. Note however, that JMeter does not support all the actions supported by browsers, for example it doesn’t execute JavaScript functions.
To create a valid JMeter script we strongly suggest to use the Badboy windows application, which can be downloaded here, with Badboy you can easily:
- Record the actions you want your script to perform, in a browser environment
- Replay the actions you recorded to validate the script functionality
- Export the script to .jmx format, so you can open it with the JMeter application or
- Upload the script directly from Badboy to your WatchMouse account
Exporting your Badboy script to JMeter correctly might require some customization, due to a few differences between Badboy and JMeter execution:
- JMeter doesn’t execute JavaScript, so in order to simulate JavaScript functionality you might need to pass values (for example a session ID) from one call to the other, manually. You can do this by saving a specific value, after an HTTP request, in a variable and use this variable in subsequent HTTP requests.
- Badboy executes its actions in a linear fashion while JMeter needs to define a scope for every action (element). So for example, if you add an assertion element, to match a text which appears after a login procedure (i.e. the text “log out”), in JMeter you should add that element as a child of the login HTTP request rather than putting it after the request in the list of calls.
- Unlike Badboy, JMeter doesn’t download the embedded elements and assets of a web page (images, css and JavaScript included files etc.). It only tests the functionality of it. You can enable downloading of embedded elements by choosing the corresponding setting in the JMeter application.
Uploading your scripts to WatchMouse
To upload the script to your WatchMouse account you have to:
- Create a new monitor
- Choose “script” in the “type” dropbox
- Upload the script, using the upload form
- Save your monitor
The WatchMouse engine will check the validity of your script and then create the new monitor.
NOTE: Due to the number of calls a script monitor performs, WatchMouse has a default timeout of 20 seconds for these type of monitors. You can adjust the timeout, according to your script, in the monitor “expert mode” settings.
Getting Help from us
You can find a set of example scripts we have created for reference, which test different kinds of applications (SOAP, OAuth, HTTP authentication) here: WatchMouse JMeter repository
We are also happy to help to construct the scripts. Just send the script to helpdesk AT watchmouse.com along with a small description of the difficulties you are facing and we will fix the script for you.
We hope this post will help you understand, as we do in WatchMouse, the importance of transaction monitor testing and also the fun of creating such tests for you websites and web applications.
Post by Nikos Prodromidis: I am a QA Tester and Junior Developer at WatchMouse. I joined the team in June 2009. I find the process of making and understanding functional tests for web applications (i.e. scripting) very interesting and innovative, also I like learning and implementing new technologies.
‘WatchMouse Weekly’ tweets and corresponding blog posts aims to be an introduction with tips and tricks for getting the most out of your WatchMouse monitoring. For all ‘WatchMouse Weekly’ blog posts go here.










