Open System Testing Architecture

TOC PREV NEXT INDEX



Creating Scripts


Script Development

After you have planned your performance Test structure, you need to develop the Test contents by recording the Scripts that will be included in your Tests. Launch Script Modeler from Commander to record and model Scripts, then incorporate them into your Tests using Commander.

Scripts are HTTP/S recordings of the Web sessions you conduct using Script Modeler which represent the HTTP/S traffic they record as SCL code. The browser requests recorded are automatically encoded using SCL during the capture process. This gives the HTTP/S data an intelligible structure and makes it possible to model the Script. Script Modeler's editing capabilities enable you to record and edit Scripts to simulate the behavior of thousands of virtual users when a Test is run.

Scripts form the content of your Tests and enable you to generate the Web activity you want during a Test-run. They are stored in the Repository, which is displayed in the Commander Main Window. From here they can be selected for inclusion by reference in multiple Tests.

When you run a Test, the Scripts that it incorporates are run according to the Task Group settings you have specified in Commander. These settings determine the load directed against the target WAE when a Test is run. Scripts encapsulate the Web activity you need to reproduce and the Task Group settings control the way the Scripts are run. Together, these elements control the type of the test environment that is simulated when a Test is run.

Before you begin to record your Scripts you should check your recording configuration. There are several options to choose from depending on the software setup you have on your computer and the network configuration you are working within. You can select the type of browser you want to use to record your Scripts, as well as the method of connecting to the target WAE.

See also:

The Script Development Process

The Script Development Process

The Script development process typically includes the following procedures:

Configuring Script Modeler for Script Recording
Script Recording
See also:

Modeling Scripts

Add Scripts to a Test

The Gateway and Script Creation

The Gateway and Script Creation

Script Modeler enables you to create Scripts by rerouting the HTTP/S traffic that passes between a browser and WAEs, through the Gateway and recording the data it intercepts. The Gateway achieves this by temporarily overriding the Local Area Network (LAN), settings specified in your browser when you begin recording a Script. The browser's proxy server settings are temporarily modified in order to force it to use a proxy server when the browser is launched. This override directs the browser's internet connection through the Gateway which functions as the specified proxy server.

The Gateway listens for browser requests then forwards them to the target WAE, or to another proxy server if your browser normally has one defined, and then on to the WAE. When you start recording a Script, your Web browser is launched and the Gateway records the HTTP/S requests along with the WAEs responses to your browser.

The home page, address settings of your browser are also temporarily altered by the Gateway during Script recording. This removes all reference to the home page URL from the Script, since it is unlikely to form a part of the Script you create. Enter a URL in the Address text box to launch the WAE of your choice. When you have completed your recordings the original browser settings are restored.

See also:

Local Area Network Settings

Local Area Network Settings

The Local Area Network (LAN) settings for your browser are temporarily modified by Script Modeler, when you begin recording a Script and for the duration of the recording session. Script Modeler forces your browser to use a proxy sever in order to re-route HTTP/S traffic through the Gateway where it is recorded. The configuration of any existing proxy server settings you may have, are unaffected by this temporary alteration of your browser settings. So browser requests are correctly forwarded from the Gateway to the WAE. Your browser's original proxy settings are restored after the capture process is complete.

The Gateway has two recording modes, local and remote. In local mode the internet connection settings are overridden as described above. Whereas in remote recording mode you need to modify the proxy settings of the remote browser manually in order to use the proxy Gateway.

See also:

Check Your LAN Proxy Server Settings

Using a Dial Up Connection

The Script Recording Process

Check Your LAN Proxy Server Settings

Using a Dial Up Connection

A dial up internet connection setup involves establishing a connection within Script Modeler when you begin an HTTP/S recording and the browser is launched. As well as entering your dial up settings, including user name and password, you must manually change the proxy server settings. Script Modeler only automates the configuration of the proxy server settings for a LAN connection. You need to select to use a proxy server to direct your internet connection through the Gateway.

See also:

Set Your Proxy Server Settings for a Dial Up Connection

Set Your Proxy Server Settings for a Dial Up Connection
  1. Select Tools > Internet Options > Connections > Settings.
    The screen shot below shows the proxy settings for a dial up connection:
  2. In the Settings dialog box, click the Use a proxy server check box, enter the Address (your computer name) and Port details (port no. 81).
  3. Enter your details as usual, then click OK to connect.

The Script Recording Process

Script Modeler creates a Script exactly as the browser requested the Web pages and their contents. They are created by the Gateway and consist of SCL code, including GET, POST and HEAD commands, which represent corresponding HTTP/S instructions.

Scripts represent HTTP/S browser requests in SCL code and are saved in a .HTP file. During the same recording session the corresponding WAE responses are recorded by the Gateway in a .ALL file. This includes DOM, HTML and Web page structure data. The full detail of a Web session is stored in these two files.

After you have clicked the Record button in the Capture/Replay Toolbar and entered the first URL in your browser's Address text box, the WAE responds by sending the HTTP/S data that forms the content of the Web page displayed by your browser.

Loading a Web page involves parsing or compiling the Web page structure from the raw HTTP/S data returned by the WAE in response to the URL or PRIMARY GET. The content is then rendered on screen by the browser whilst concurrently making additional, asynchronous requests on other TCP connections via secondary GETs for the remaining contents of the Web page. The browser continues to issue requests and render any remaining content until the Web page is fully loaded. The Gateway records and formats this information.

The Script Modeler HTTP/S capture process is illustrated below:

Browser requests hit the target WAE via the Gateway, across the Internet or other network. Browser requests are recorded by the Gateway as a Script (.HTP file). WAE responses are recorded by the Gateway in a .ALL file.

Note: OpenSTA Console refers to a computer which has an installation of OpenSTA. This includes the OpenSTA Architecture and Commander and it may also include the Repository, where all Test related files and results are stored. The PC will also have a Web browser installed and is typically the home for the Gateway. In this diagram the Gateway is shown as separated from the OpenSTA Console to clarify the Script recording process.

See also:

Script Modeler Configuration Options

Script Modeler Configuration Options

Before you capture a new Script there are some configuration options available within Script Modeler that you may want to check or change. Some of these options relate to the type of Web browser(s) you have installed on your computer, the settings you have specified for them and the Gateway recording mode you want to use, either Local or Remote.

Other configuration options available relate to Gateway settings that can assist you during the recording process and afterwards if you need to model your Script.

You can opt to display a command line console which displays the activity of the Gateway during recordings and to trace this activity.

Another Gateway setting allows the automatic generation of variables to replace any cookies received during a Web session. Automating the substitution of a variable for the unique identity of the original cookie transmitted helps to simplify modeling and speed up the development of your Tests.

Use the Options menu choices to configure your settings.

See also:

Browser Settings

Configuring The Gateway: Local and Remote Recording

Gateway Settings

Creating New Scripts

Browser Settings

If you have more than one type of browser installed on your computer, you can choose which one you want to launch in order to record your Scripts.

OpenSTA currently supports Internet Explorer 4 and 5, and Netscape Navigator 4.7, for use in HTTP/S captures. If you have several browsers installed on your computer you may want to specify which browser is launched when you begin recording a Script. If you have more than one of the browser types mentioned installed and you do not select one, Script Modeler defaults to the latest version of Internet Explorer installed on your computer.

See also:

Select Browser Type for Script Recording

Select Browser Type for Script Recording
  1. In Script Modeler, select Options > Browser.
  2. In the Select Browser dialog box, click , and select the browser you want from the list, either Internet Explorer 4, Internet Explorer 5 or Netscape.
    Note: The Netscape option refers to Netscape Navigator version 4.7
  3. Click OK to save your settings.

Configuring The Gateway: Local and Remote Recording

You can choose to record Scripts on your own computer or through another remote computer by selecting the appropriate Gateway recording mode, either Local or Remote.

In local recording mode the browser you have selected to use is launched when you begin the HTTP/S capture process you are recording from. The default mode for capturing HTTP/S traffic through the Gateway is Local. In this mode the Gateway listens on port 81 for HTTP/S traffic by default.

If there is no browser installed, or if you want to use another computer to record your Scripts, you can choose the Remote recording mode. You can use any networked computer with a browser installed to conduct remote Script recording. If you use Remote recording mode you must manually modify the proxy server settings of the browser on the remote computer. Make a note of these settings because you need to copy them exactly into the Gateway settings on the computer from where you are recording.

See also:

Select the Gateway's Local Recording Mode

Select the Gateway's Remote Recording Mode

Select the Gateway's Local Recording Mode

Note: Local Recording Mode is the default setting.

  1. In Script Modeler, select Options > Gateway.
    Note: If you selected to use Netscape Navigator 4.7 to conduct your recordings, then a browser Information dialog appears.
    Click and locate the Netscape preferences file prefs.js. After you have selected the file, click OK to move on to the Gateway dialog box.
  2. In the Gateway dialog box Capture section, click Local.
  3. Type in an Administration Port and Port number if the defaults displayed here are in use. Otherwise accept the defaults displayed.
    Note: The Administration Port is used for internal communication between Script Modeler and the Gateway.
  4. Click OK to save your settings.
    Note: These settings apply to all subsequent Script recordings until you change them.
Select the Gateway's Remote Recording Mode
  1. In Script Modeler, select Options > Gateway.
    Note: If you selected to use Netscape Navigator 4.7 to conduct your recordings, then a browser Information dialog appears.
    Click and locate the Netscape preferences file prefs.js. After you have selected the file, click OK to move on to the Gateway dialog box.
  2. In the Gateway dialog box Capture section, click Remote.
  3. Type in an Administration Port and Port number if the defaults displayed here are in use. Otherwise accept the defaults displayed.
    Note: The Administration Port is used for internal communication between Script Modeler and the Gateway.
  4. In the Proxy section of the Gateway dialog box, the selections you make must reflect the settings specified in the Proxy settings dialog of the remote computer you are using, these settings include:
  1. Click OK to save your settings.
    Note: These settings apply to all subsequent recordings until you change them.

Gateway Settings

The Settings section of the Gateway dialog box offers you options which you can select to enhance the quality of the Scripts you record and improve the visibility of the recording process.

Select the Console option to display a command line window during the recording process. The console displays Gateway activity during the Web session.

Select the Automatic Cookie Generation option to automate the processing of any cookies you record in your Scripts. If the WAE you are testing generates cookies, then enabling this function can help to speed up the Test creation process. This option automatically substitutes the unique identities of any cookies received from a WAE with a variable. The automatic modeling of cookies is an optional feature but active by default.

Automatic Cookie Generation

Any cookies issued by a WAE under test are recorded in the Scripts you create. If cookies include unique session identity information such as a time stamp, the Scripts that contain them will be rejected by the target WAE when replayed during a Test-run unless they are modeled.

Modeling cookies is an essential procedure that enables Scripts to be used in Tests. It involves replacing the unique session identity encapsulated by a cookie from the original Web session and it is achieved by assigning the fixed values recorded to a variable. Script Modeler gives you the option to automate this task or to manually model Scripts depending on your requirements. The default setting in Script Modeler is for automatic cookie generation.

Selecting to automatically model cookies can help improve the efficiency of the Test development process. It also enables you to develop a modular Test structure by incorporating a sequence of Scripts in a Task Group to function as one browser session during a Test-run, without having to model the cookie information. For more information on developing a Task Group that combines multiple Scripts, see Developing a Modular Test Structure.

See also:

Select Automatic Cookie Modeling

View Gateway HTTP/S Traffic During Script Recording

Developing a Modular Test Structure

Select Automatic Cookie Modeling
  1. In Script Modeler, select Options > Gateway.
  2. Click the Automatic Cookie Generation check box.
View Gateway HTTP/S Traffic During Script Recording
  1. In Script Modeler, select Options > Gateway.
  2. Click the Console check box to view a Command Line window during the Script capture process.
    This console displays the Gateway initiating HTTP/S connections and receiving WAE responses, concurrent to the actions you perform using the browser.

Creating New Scripts

After you have configured the Gateway and chosen the Web browser you want to use for Script recording you are ready to begin the HTTP/S capture process.

Recording Scripts is straightforward.

In the Commander Menu Bar select File > New Script > HTTP, or right-click Scripts  in the Repository Window and select New Script from the menu. Give the Script a name, press return and double-click the new Script icon in the Repository Window to launch Script Modeler.

Use the Capture/Replay Toolbar or the Capture menu option in Script Modeler to control the recording process.

After you have recorded a Script you can either save it or begin the next recording by selecting File > New. You can have several Scripts open at the same time if required so you can either save your Scripts as you record them or before you exit. Press Ctrl > Tab to switch between the Scripts you have open.

Two files are generated during a recording session and stored in the Repository after you save, a .HTP file, or Script, which records the Web browser requests, and a .ALL file which records the WAE responses and contains HTML data.

Script names must be defined according to the rules for OpenSTA Datanames, with the exception that the name can be up to 60 characters long.

After you have saved the Script it appears in Repository Window . The small crossed red circle is removed indicating that the Script is ready for use. Drag and drop the Scripts you need from the Repository Window into your Tests.

Note: If you want to create a Test that simulates a first time user and you have previously accessed the target WAE, make sure you clear the browser's memory cache before recording your Scripts. In Internet Explorer 5, temporary Internet files are removed by selecting Tools > Internet Options then clicking the Delete Files button.

See also:

Capture/Replay Toolbar

Create a New Script

Modeling Scripts

Developing a Modular Test Structure

Capture/Replay Toolbar

The Capture/Replay Toolbar is used to control the Script recording process. It is located below the Menu Bar in the Script Modeler window. You can use it to record multiple Scripts during the same Web browser session

.

Click the Record button , in the Capture/Replay Toolbar to begin the HTTP/S capture process. This action launches your Web browser which in turn activates the Gateway, or Proxy Server. The HTTP/S traffic generated during the recording session is intercepted by the Gateway and the HTTP/S requests are encoded to produce a Script written in SCL. This data is displayed in the Script Pane after the recording process is complete. The HTML pages accessed during the Web session are recorded in a separate file and can be displayed in the Query Results Pane.

Use the Add Comment button , to add comments during a recording session. They are used to assist you when monitoring a single stepping session.

Use the Pause button to suspend Script recording. Click to resume recording.

When you have recorded everything you need, end your recording session by clicking the Stop button , or close down the browser.

Use the Syntax Check button to compile the current Script. The SCL compiler is launched and generates an object file called a .TOF file. This is the file that is executed by a Task Group Executer when a Test is run.

Use the Replay button to compile the current Script and replay it within Script Modeler to ensure that it is valid. Replay activity can be monitored using the Output Pane.

See also:

Create a New Script

Single Stepping Comments

Create a New Script
  1. In Commander select File > New Script > HTTP.
    Or: In the Repository Window, right-click Scripts, and select New Script > HTTP.
    The Script appears in the Repository Window with a small crossed red circle over the Script icon , indicating that the file has no content. As soon as you open the Script and record a Web session, the icon changes to reflect this and appears .
  2. Give the new Script a name within the Repository Window, which must be an OpenSTA Dataname, with the exception that the name can be up to 60 characters long, then press Return.
  3. Double-click the new Script icon , to launch Script Modeler.
  4. Click the Record button , in the Capture/Replay Toolbar, or select Capture > Record, to begin the HTTP/S capture process.
    This action launches the Gateway and the Web browser you have selected.
    Your browser's Home page Internet option is overridden by Script Modeler when you start recording. The setting is replaced with about:blank, which specifies that your home page will be a blank HTML page. This ensures that your normal Home page is not launched and recorded in the Script.
    Note: The Gateway is launched in Local recording mode by default unless you have chosen Remote recording mode.
  5. Type in a URL and hit Return or select a URL from the browser's URL Address bar. Then use the browser as normal to perform the actions you want to record in your Script.
    Tip: Use the Add Comment button in the Capture/Replay Toolbar to add comments while you are recording a Web session, or select Capture > Insert Comments. They are used to assist you when monitoring a single stepping session. The time taken to add a comment is not recorded in the Script.
  6. After you have completed the browser actions you need, switch back to Script Modeler from the browser and click the Stop button , in the Capture/Replay Toolbar to end the recording. Or, close the browser.
    Tip: If you have more than one Script to record use to end a recording, to save repeatedly closing and opening the browser.
    When you have finished recording the Script the SCL formatted data is displayed in the Script Pane as illustrated below:
  7. Before you save your new Script you need to compile it using the Syntax Check option to ensure the validity of the recording.
    Select Capture > Syntax Check or click , in the Capture/Replay Toolbar. Compilation results are reported in the Output Pane. If compilation is unsuccessful, you may need to re-record the Script or model the contents to resolve the problem.
    Note: You can record over the top of an existing Script until you achieve the content you need.
  8. After compilation replay the Script to check the activity you have recorded.
    Select Capture > Replay or click , in the Capture/Replay Toolbar
  9. When you have finished recording, click , in the Standard Toolbar to save your Script in the Repository, or click File > Save.
  10. Select File > Close to close the current Script or File > Exit to exit Script Modeler.
    Note: If you have unsaved Scripts open in Script Modeler, you are automatically prompted to save them before the program closes. Closing down Script Modeler also closes the browser which restores your original browser settings.
See also:

Create Additional Scripts

Modeling Scripts

Developing a Modular Test Structure

Single Stepping Comments

Create Additional Scripts

Once you have launched Script Modeler you can record additional Scripts.

  1. In Script Modeler, select File > New.
    Shortcut: Click , in the Standard Toolbar, or press Ctrl + N.
  2. Click the Record button , in the Capture/Replay Toolbar, or select Capture > Record, to begin the HTTP/S capture process.
  3. In the Script Name dialog box, give the new Script a name, which must be an OpenSTA Dataname, with the exception that the name can be up to 60 characters long.
    Click OK to launch the Gateway and the Web browser you have selected and begin recording. Create your Script as usual, see Create a New Script for details.
Save a Script
Close a Script
Rename a Script
  1. In Commander, double-click Scripts, in the Repository Window to expand the directory.
  2. Right-click the Script and select Rename, or double-click slowly on the Script.
  3. Enter the new name and press Return, to save your changes in the Repository.
    Note: When you rename a Script the Tests that reference it notify you that it is missing by highlighting the Task table cell it occupied in red when the Test is opened. The Test cannot run with a missing Task. Rename or recreate a Script to match the name of the missing Script to resolve this problem or delete the Task from the Test.
Delete a Script
  1. In Commander, double-click Scripts, in the Repository Window to expand the directory.
  2. Right-click on the Script and select Delete from the menu.
    Or click on the Script you want to remove and press Delete.
  3. Click Yes to confirm the deletion.
    Note: When you delete a Script, the Tests that reference it notify you that it is missing by highlighting the Task table cell it occupied in red when the Test is opened. The Test cannot run with a missing Task. Recreate a Script with the same name as the missing Script to resolve this problem or delete the Task from the Test.
    Note: Your changes are automatically saved in the Repository.


OpenSTA.org
Mailing Lists
Further enquiries
Documentation feedback
CYRANO.com
TOC PREV NEXT INDEX