User Guide

Related topics

TestMaker Briefing
TestMaker Tutorial
Recording AgentsExample Agents
Recording Agents
XSTest Load Test
TestMaker Script Guide
TOOL Guide
Testing Email Services

Frequently Asked Questions
License Details
TestMaker Platform (TestNetwork)
Support Options
Updates & Downloads (on-line)
On-line Documents

Published: April 17, 2006
Applies to: TestMaker 4.4


New Agent Wizard: Recorder

TestMaker offers a New Agent Wizard to write test agent scripts for you. The Recorder is a type of New Agent Wizard that watches you use a Web browser and writes a test agent script automatically. You play-back the recorded test agent script to check the Web application for functionality. The recorded test agent script may optionally be used with XSTest to perform a scalability and performance test on the Web application. The recorded test agent script may also optionally be used as a Quality of Service monitor using the Service Monitor System (SMS.)

This section describes these topics:

 


A Brief Tutorial

The Agent Recorder watches you drive a Web-enabled application using your browser and writes a test agent script for you. You may play-back the test agent script in TestMaker or from the command-line to perform a functional (unit) test. Recorded test agents may be plugged-into the XSTest framework to conduct scalability, performance and plugged-into the Service Monitor System (SMS) for a live dashboard that monitors the service.

The Recorder is built around a smart proxy server that watches for HTTP traffic between your browser and the service. The proxy decodes HTTP GET and POST commands from the browser and the responses from the server. The proxy then writes the Jython and TOOL script commands necessary to replay your use of the Web-enabled application. This design supports HTTP 1.0 and 1.1 compliant browsers, including the use of JavaScript, plug-ins, and ActiveX objects, and Java applets.

The Agent Recorder does not support HTTPS connections. By the time the TestMaker proxy receives the request from the browser, the request is encrypted and TestMaker is not able to decode the body of the HTTP protocol. The only workaround at this time is to temporarily host your application with SSL encryption turned-off while you record the test and then turn on SSL encryption when you play-back the test.

Before using the Recorder you will need to configure your browser to communicate through the Recorder proxy. By default, TestMaker sets the proxy port to 8090. Your browser preferences is usually the place to set the used proxy port to be used. Each browser is different at controlling the proxy server. For example, in Microsoft Internet Explorer 6.0 for Windows 2000, the proxy server settings are found by choosing the Internet Options command in the Tools drop-down menu. Choose the Connections tab and click the LAN Settings... button. The lower portion of the dialog that appears controls the Proxy server settings.

If port 8090 is already in use on your system then change the TestMaker proxy server to use a different port number. In TestMaker choose the Preferences command in the Help drop-down menu and then choose the Recorder tab.

With the proxy settings configured, every request from the browser will go through TestMaker's proxy server. This has a side effect in that TestMaker needs to be running for you to use your browser.

Next we will Record a test of the Web-enabled application hosted at examples.pushtotest.com. The application is a simple servlet that responds with Web pages. Depending on the parameters send to the servlet the response can be a Web page containing random content, responses to HTTP Post commands with HTML forms, and provides a Web site with HTML links our recorded test will follow.

Follow these steps:

1. Configure your browser to use Proxy port 8090.

2. Start TestMaker.

3. Choose File -> New -> HTML Agent Recorder or click the Recorder button.

4. TestMaker displays a dialog asking for the name of the new test agent. Type MyFirstTest.



5. Click the Start Recording button.

6. Point your browser to this URL: http://examples.pushtotest.com/responder/htmlresponder

7. Click the file2.html link. You should find the link about halfway down the Web page.

8. The browser will display a new Web page that contains two forms. In the top-most form, enter your first and last name, and your phone number. Then enter 1081 as the account number and 75.36 in the amount field. Click the Transfer Funds button.

9. Your browser will show a new Web page that echoes the HTML form information you submitted on the previous page.

10. Return to TestMaker and click the Stop Recording button.

11. TestMaker will display a standard file selector dialog. Navigate to the directory you wish to store the new agent, enter a file name for the agent, and click the Save button.

12. The new test agent script will appear in the Editor panel in TestMaker.

Congratulations. You recorded your first test agent script.

To play-back the new agent script, click the Run icon in the Execution panel. Alternatively you may choose the Run command in the Agent drop-down menu.

The agent will replay the steps you took while using the browser to drive the Web-enabled application on the examples.pushtotest.com domain. You will see the results of the play-back in the Output panel.

 


Advanced Options

The Recorder includes several advanced options to make the recorded scripts act in real-world manner. The advanced options include the ability to load image references embedded in an retrieved Web page, follow 302-redirect responses from the Web host, and much more. The Recorder's advanced options are viewed by clicking the Advanced Options button from the Recorder window. Click the Advanced Options button to expand the window to see the following interface:

 

 

The Recorder offers the following advanced options:

Log To

As TestMaker runs a test agent script it outputs logged informational and results information. This controls the destination of the logged data.

Log Path/Name

Destination file name and path to write the logged data TestMaker generates while running a test agent. The Browse button displays a standard file selector to graphically navigate the file system and directories.

Log Level

Controls the amount of information logged by the test agent, including:

Sleep Time

This setting controls the minimum and maximum amount of time, in seconds, to pause between Web page requests. You set the minimum and maximum values and the test agent chooses an amount of time between the two values to pause.

Success Responses

This is a Regular Express (regex) defining the HTTP response codes that indicate the request was accepted by the Web host. By default this regex considers HTTP response codes of 200-299, and 300-304, and others to be successful responses. HTTP response codes of 500, for example, are not part of the regex and so the test agent throws an exception.

Follow HTTP 302 Redirects

Web hosts may return a 302 response code to direct a Web browser to load another page. Checking this field tells the test agent at runtime to follow 302 reponse codes and load them automatically.

Load <IMG> Tag References

When checked the recorded test agent will automatically parse a retrieved Web page for <img> image tag references and make HTTP requests to load the images. If File with response is checked then the test agent will store the URL, time it takes to load the image, and image size in bytes for each image in the Web page.

TestMaker uses the TagSoup library to parse HTML pages for <img> tag references. Instead of parsing well-formed or valid XML, TagSoup parses HTML as it is found in the wild: nasty and brutish world of the Web. It makes a best effort to parse a Web page. The test agent will show errors in the logged data when they occur.

Load <IMG> Tag References

This determines the number of seconds the test agent will pause before loading the next <img> tag reference.

Emulate Browser Image Caching

Web browsers usually store downloaded images in a local cache. When checked this instructs the test agent to avoid loading the same <img> tag references more than once.


Customizing Advanced Options

Test agent scripts created by the TestMaker Recorder implement a Jython class that inherits the advaned option functions from a base class found in testmaker_home/lib/agentbase.py.

We encourage you to read through the agentbase.py script and make changes that help you improve your recorded scripts. In some cases you will need to change agentbase.py to enable a function. For example, the Log to Database option requires you to configure your JDBC driver in agentbase.py.

We also encourage you to share your changes and improvements with the TestMaker open-source community. Send your improvements to info@pushtotest.com. Thanks, in advance.


What comes next? Try one of these:

TestMaker Script Language Reference

Reference to the TOOL test object library

A guide to the example agents that come with TestMaker

A list of frequently asked questions

Building test agents to check email services for scalability and functionality



Additional documentation, product downloads and updates are at www.PushToTest.com. While the TestMaker software is distributed under an open-source license, the documentation remains (c) 2006 PushToTest. All rights reserved.