OpenSTA Getting Started Guide

4.0 Recording Scripts

The test has now been created and the Commander windows should look like the one shown below. The script you have defined is named but has a red icon with a white cross (figure 4-0-1). This indicates that the script has not yet been recorded.

Figure 4-0-1

The simple application that you are going to use is called FindPres and provides the user with a variety of information concerning past Presidents of America. The application has 4 main parts:

The logon page requires a user name and password. There are no pre-defined users but to gain access to the next part of the application the user must specify a password that is the mirror or the user name. For example, if the user name entered were JOHN, the password would have to be NHOJ.

Once past the logon page the web server keeps track of the user by issuing a cookie that contains a session identifier (session id). The session will expire if it is not used for 5 minutes. Each time the user interacts with the web site the cookies are updated.

In the next few sections you will record a script that will capture a number of things including the cookies that the server passes to the browser, the user name and password that is used. You will then model these in the next section so that you can run a load test with each user using different logins and the server providing unique session cookies.

To record a script you must first start the Modeler. To do this, expand the test you have defined in the Test tree view as shown above. Double click on the script name FINDBYNAME. The Modeler should then appear as below. The screen is split in to three sections (figure 4-0-2).

Figure 4-0-2

The left-hand side will show the SCL code for a script. The right hand side can show one of five different categories of information for an individual page. These are:

The bottom part of the window shows the progress of any script compilation or script replay.

Before you start recording select Options> Browser and the following box will appear (figure 4-0-3):

Figure 4-0-3

Use the drop down list to select a browser version you have installed on the machine that has OpenSTA installed. The options are IE4, IE5 and Netscape. You must specify this because when starting recording the Modeler will modify the proxy settings in the browser to point to the OpenSTA Gateway. Effectively the Gateway is just another proxy. The original proxy settings will still be used and will be restored when the Modeler is closed.

If you use auto detection or run a script to find your proxy, you will need to disable this and enter the name and port number of your usual proxy server.

To start recording, click on the Record button (red circle) button on the power tool bar (figure 4-0-4).

Figure 4-0-4

Having clicked on the record button the Script Modeler starts the proxy Gateway and a browser session. If you look closely at your browser you will see that the URL is HTTP:///. Be sure to remove the third slash before you proceed.

Once the browser has started it is worth checking the browser options to be sure that the proxy settings have been set. The screen shot below shows the LAN settings going via a proxy on machine ZXR port 81 in IE 5. Note that options:

Are not being used.

The screen shot below (figure 4-0-5) shows the proxy settings but this time for an IE 5 dial up connection. OpenSTA only configures proxy settings for the LAN connection. If you are using a dial up link you will need to change the settings to match those in the LAN proxy configuration above.

Figure 4-0-5

Type the following URL in your browser to access the demonstration Web application:

http://demosite.opensta.com/gsg-v1

Once the page has loaded in to the browser, enter a in the Login ID text. Enter a in the Password text box, and then click on the gray Login button (figure 4-0-6).

Figure 4-0-6

Note that the application does not have a user database. To get past the Login page the password must be a mirror of the Login ID. To keep things simple just enter a single letter as above.

The next page will then appear as follows (figure 4-0-7):

Figure 4-0-7

As you have named the script you are recording FINDBYNAME enter a Presidents last name. Keep following the example and type Adams as shown below (figure 4-0-8), then click on the Submit Query button.

Figure 4-0-8

The combined search and results page should then appear as shown below (figure 4-0-9). Next click on the LOG OUT link.

Figure 4-0-9

The Logon page should then appear (figure 4-0-10).

Figure 4-0-10

You now need to stop recording the script. To do this switch back to the Modeler (by using the normal Windows methods) and click on the Stop button (black square) in the power tools bar. The Modeler should then look something like the screen below (figure 4-0-11).

Figure 4-0-11

Scroll down through the script and notice the different script sections ENVIRONMENT, DEFINITIONS and CODE. In the screen shot below, the right hand side of the screen has been populated. To do this scroll to the second primary POST in the script (a primary GET or POST is indicated by the appearance of a Yellow Triangle in to the left of the GET/POST in the SCL code window), and then click on the URL Details button (yellow arrow) on the power tool bar. The screen below (figure 4-0-12) shows the HTML tab view on the right hand side of the window.

Figure 4-0-12

The screen shot below (figure 4-0-13) shows the Structure tab. This can be used to directly address some of the main parts of an HTML page that a user may want to include in a test.

Figure 4-0-13

The screen below (figure 4-0-14) shows the DOM tab. Both the STRUCTURE and DOM views are very useful features of OpenSTA. Using these it is possible to make the SCL scripts more dynamic. For example, changing the objects retrieved by secondary GETS or retrieving information from the DOM to verify further the application's performance under load. The Reference Guide provides further information about these features.

Figure 4-0-14

You may also click on the Server Header and Client Headers that summarize the HTTP headers that have passed between the browser and the server.

Having recorded the script the next step is to compile it and then save it. Click on Capture > Syntax Check and the Modeler screen should appear as below (figure 4-0-15):

Figure 4-0-15

Close the Modeler by selecting File > Exit and then clicking Yes to save the script when prompted. You will then automatically return to Commander and your screen should look as shown below (figure 4-0-16). Notice now that the white cross on a red background has been replaced with a script graphic, indicating that you have recorded the script.

Figure 4-0-16

Index
Previous Section : Creating a test
Next Section : Modelling scripts