Script Manager

Script Manager records the script, and manages and applies parameterization and correlation. Users can further insert transactions in the script and can verify by putting checkpoints.

Script

A Script represents a typical session of a web application’s user interaction. It has a well-defined structure and keeps documentation of web application user actions. NetStorm executes a script to emulate a web user activity. A script can be executed several times during a test.

Virtual User

Virtual users or Vusers are the conceptual users who emulate human users interacting with applications executing a test script. A virtual user is the software simulation of a real-world user and a session represents what it does. Each group consists of a number of virtual users executing a test script.

Session Count

A session represents a sequence of page navigation by a user. Session count is the number of occurrences of sessions. It depends on the number of pages a user is accessing and a total number of users.

Fixed Session Rate

Fixed Session Rate or FSR indicates that while running a scenario, session rate is fixed.  Once a Vuser is removed from the system, the connection is closed. The user injects into the system as per the need. To achieve the session rate as defined in the scenario, users come into the system. Scenarios on FCUs are of the following types:

  • Simple Scenario Based
  • Simple Group Based
  • Advance Scenario Based
  • Advance Group Based

Fixed Concurrent User

Fixed Concurrent User or FCU indicates that while running a scenario, the number of users is fixed before the start of the test.  Scenarios on FCUs are of the following types:

  • Simple Scenario Based
  • Simple Group Based
  • Advance Scenario Based
  • Advance Group Based

Think Time

It is really unrealistic for any real user to just keep clicking the pages one after the other without pausing to look at them. The user spends some time viewing the pages that are downloaded. The average viewing time depends upon the page contents & the user’s familiarity with the page. Each page may be assigned a think time. If a think time is not associated with a specific page, the default page thinks time would be used for such pages. Page Think Time is also called Page View Time (after a page is downloaded).

Script Types

There are the following types of Scripts:

  • WebC (HTTP/HTML): This protocol is used to record scripts that are ‘C’ language syntax-based functions using NetStorm APIs. Users can either use NetStorm Browser or Internet Explorer/Mozilla Firefox for recording these scripts. These scripts are recorded as flow files per user session.
  • WebClickAndScript: This protocol is used to record scripts that are ‘C’ language syntax-based functions using NetStorm APIs. The default browser available for these types of scripts is NetStorm Browser. These scripts are also recorded as Flow files which contain NetStorm APIs per user interaction with different input fields such as input box, radio button, etc.
  • WebJava (HTTP/HTML): This protocol is used to record scripts that are ‘Java’ language syntax-based functions using NetStorm APIs. Users can either use NetStorm Browser or Internet Explorer/Mozilla Firefox for recording these scripts. These scripts are recorded as flow files per user session.
  • WebServices: This protocol is used to record scripts that are C language syntax-based functions using NetStorm APIs same as WebC protocol.

Script Structure

A Script consists of list of files – flow.c, init_script.c, exit_script.c, registrations.spec, and runlogic.c.

ScriptFigure 1: Script Structure

A detailed description of each file of the Script structure is provided below:

flow.c

  • This file contains main URLs, headers, and embedded URLs.
  • It contains the main execution loop & the URLs that are accessed by NetStorm.
  • Transaction and CAPI is added from flow.c file.
  • Parameters and Checkpoints can be added from the flow file of the script. After adding checkpoint and Parameter, API is added in registrations.spec file.

init_script.c

  • Any initialization can be done here.
  • Any relevant NS C API can be used in this file.
  • This file is internally called by NetStorm.

exit_script.c

  • When the user completed the execution of flow the c file is called.
  • This file is internally called by NetStorm.

registrations.spec

  • Checkpoints and Parameters are added in this file.
  • Parameters and Checkpoints can be added from the flow file of script. After adding checkpoint and Parameter, API is added in registrations.spec file.
  • The defaultspec file is hidden and the user can display it after clicking the Show/ Hide registrations. spec file option in the View menu.

runlogic.c

  • RunLogic allows users to create a custom flow to be executed by NetStorm.
  • Flows of the scripts can be ordered here.
  • With RunLogic –
    • All pages/flows can execute as per the requirement
    • Good control over the execution of pages or the group of pages (Blocks)

Directory Structure

A Script consists of a list of directories – Dump Directory, and runlogic.c. A detailed description of the Script Manager Directory structure is provided below:

Dump Directory

It contains: –

  • Header file: It contains the request and response of each page.
  • list: It contains the URL of all the pages.
  • Pages.html
  • PagesList.html

Temp Directory

It contains: –

  • changed_url.txt: This file contains the URL whose names are parsed.
  • logs:  This file contains Script Recorder_debug.log and script_Recorder_error.log.

Launch Script Manager

Follow the below-mentioned steps to login into the NetStorm portal:

  1. Enter the following URL (http://hostname/netstorm) at the address bar of the browser and press ENTER. The NetStorm login window is displayed.Launch Script Manager Figure 2: Login Page
  2. Enter the Username and Password and click Login The NetStorm – Product UI Home page is displayed as shown in Figure 3.

UI Home Page

Figure 3: UI Home Page

3. Go to Script on the top panel and then click the Launch Script manager iconmenu item.

Figure 4: Launch Script Manager

4. The system prompts them to open the recorder.jsp file. Select the Open with option and Click OK. Note: The procedure for Launching Script Manager may vary based on the Browser and other settings.

Figure 5: Recorder.jsp page

5. Once the application is downloaded and verification is completed, the security warning dialog box is displayed as shown in Figure 6.

Figure 6: Security Warning Box

 6. Click the Run A dialog box for getting the script message displayed in Figure 7.

Figure 7: Getting Scripts Message Box

Figure 7: Getting Scripts Message Box

If the user clicks the Run in Background button, this dialog box is disabled and scripts run in the background.

 

7. After getting Scripts and loading the background files, the Script Manager window is displayed.

Figure 8 Script Manager Window

Figure 8: Script Manager Window

To open the Script Manager window, select SCRIPT > Launch Script Manager. The Script Manager window is displayed, as shown below:

Figure 9 Script Manager Page

Figure 9: Script Manager Page

Using an Installer to Launch Script Manager

You can also launch the Script Manager by downloading the installer.

  1. Log into NetStorm.
  2. Select Scripts > Download Script Manager.

Figure10: Launch Script Manager

3. The ScriptManager.exe file is downloaded within the Downloads folder.

Figure 11: Scriptmanager.exe

Figure 11: Scriptmanager.exe

4. Launch the Script Manager by double-clicking the ScriptManager.exe file.

5. Provide the Controller URL (the IP of the machine for which the user needs script manager to be accessed), User Name (username of the machine), and Password (login password) and click Login.

Figure 12: Script Manager Login

Figure 12: Script Manager Login

6. After login, the Script Manager window is displayed to the user.

 

Figure 13: Script Manager

Figure 13: Script Manager

Script Manager Screen Details

Script Manager Screen contains the following sections: 

  1. Menu bar
  2. Toolbar
  3. Left pane
  4. Right pane
  5. Bottom pane

1. Menu bar

Script Manager Menu bar contains the following main menus:

  • File
  • Edit
  • View
  • Action
  • TabList

    File

    The file menu contains the following sub-menus/menu-items.

     Figure 20: File

      New

     The new option is used to create a new file/directory inside the script.

Figure 21: New Option

                        To create a file/directory inside the script, the user needs to select the File/Directory option accordingly.

    Insert

     Insert sub-menu has the following options.

  • Define Transaction
  • Start Transaction
  • End Transaction
  • C API
  • JAVA API
  • Action API
  • JMS API
  • Comments
  • Checkpoints

Figure 22: Insert

                              Transaction details are covered in Chapter 4: Setting Transactions, later in this document.

      Parameters

       The parameters sub-menu has options for different types of parameters to use            in the Script, they are as follows:

  • File Parameters
  • Search Parameters
  • Declare Parameters
  • XML Parameters
  • Index File Parameters
  • Date Time Parameters
  • Random String Parameters
  • Random Number Parameters
  • Unique Number Parameters
  • Declare Array Parameters
  • Json Parameters
  • Unique Range Parameters
  • SQL Parameters

Figure 23: Parameter

        Parameter details are covered in Chapter 6: Parameterization, later in this document.

 

       Save

       The save option is to save the script after being edited.

        Exit

The exit option is used to exit from Script Manager GUI.

       Edit

        The Edit menu contains the following sub-menus/menu items.

Figure 24: Edit Options

  • Find: Find string(s) in a file
  • Replace: Replace string(s) in a file
  • Go to Line: Go to a specific line in the file
  • Word Wrap: Confines the data in the file within defined margins
  • External Libraries: To add external libraries
  • Create Script: To create a script
  • Create Script with WSDL: To create a script with WSDL.
  • Copy Script: To copy the script
  • Delete Script: To delete an unwanted script
  • Rename Script: To rename a script
  • Create Flow: To create a new flow file
  • Copy Flow: To copy the flow file
  • Rename Flow: To rename a flow file
  • Delete File: To delete a file
  • Copy File: To copy a file
  • Page(s): To View/Change the Page name of the Script
  • Append Page(s): Appends pages to another script
  • Recorder Options: This feature provides a way to split the pages while recording for different method(s)
  • Filters: To filter some URLs at the time of recording a script
  • Download Script: To download Script on the User’s system (Downloads in .zip format)
  • Upload Script: To upload a script from the User’s system to Script Manager (Script should be in .zip format).

View

The view menu contains the following sub-menus/menu items.

Figure 25: View Option

  • Run Logic: To define the flow of the execution. It is covered in detail later in this document.
  • Debug Log: To open Debug Log file
  • Error Log: To see the Error Log file
  • Snap Shot: To view the Snap Shot of the Script
  • Compare Script: To compare two or more scripts
  • View Script: To view the Script’s files in the Browser
  • View Parameters List: To view the parameters list.
  • Compile Script: To compile a script
  • Page Details: A user can see Page Detail information of recorded script, such as URL, Headers, Request and Response, Cookies, etc.
  • Test Script: It runs the Script and creates Test Run
  • Show/Hide spec: To show/hide the registrations.spec file. By default, it is visible.
  • Show/Hide Analyzer: To show/hide the HTTP analyzer.

Action

The action menu contains the following sub-menus.

Figure 26: Action Option

  • Start Recording: To start the script recording.
  • Stop Recording: To stop the script recording.
  • Pause Recording: To pause the script recording.
  • Resume Recording: To resume the script recording.
  • Cancel Recording: To cancel the script recording.
  • Version Control: To control the version
  • Enable Log: To enable the logs for debugging purposes.
  • Classic Recorder: Old recorder of NetStorm.
  • Release Memory: To release all the used memory after recording.
  • Create Script from Pcap: Pcap is an application programming interface (API) for capturing network traffic. The file with the .pcap extension is the thread dump of the network. Cavisson NetStorm can create a script from .pcap file from the Script Manager UI. The user needs to provide the Script name, project, sub-project, and pcap file path. This can be created via Actions > Create Script from Pcap.
  • Upload: To Upload the script.
  • Encode File: To encode a file in a script.

TabList

This menu contains the path of the files opened on the right page of the screen. The format is – Project/Subproject/Script/File

2. Toolbar

This contains a list of icons from where the user can perform the actions.

Figure 27: Tool Bar

SR# Icon Meaning Description
1 Start button To start Recording the script.
2 Stop button To stop recording the script.
3 Cancel button To cancel the script recording.
4 Pause button To pause script recording.
5 Resume button To resume script recording.
6 Comment button To add comments in a script.
7 Create button To create a new file inside the script.
8 Save button To save a file after editing.
9 Copy button To copy the script.
10 Download button To download the script to the local machine.
11 Upload button To upload a script from the local machine.
12   Runlogic button To open the Runlogic GUI window.
13 Delete script button To delete a selected script.
14 View Snapshot button To see the snapshot of pages of a script
15 Compile Script button To compile a script.
16 Test script button To execute the script from the script manager.
17 Commit Script Version button To commit a script version.
18 Version Control History button To view the version control history of the script.
19 View script button To view all files created after recording.
20 Synchronize button To refresh the script manager GUI. You can sync the scripts at the project, subproject, or script level.
21 Exit button To exit from the Script Manager GUI.
22 Download Project To download a project to the system.
23 Upload Project To upload a project from the system.
24 Save All BreakPoints To save all breakpoints in the script.
25 Continue To start the script replay and pauses it at the next breakpoint of the script.
26 Step by Step To run the script one line at a time.
27 Stop Test To stop the test.
28 Search Script The user can search a script by entering either the complete script name or starting characters of that script in textfield. It highlights all the scripts with that name.

3. Left Pane

The left pane contains a list of work profiles, projects, sub-projects, associated scripts, and other files. The following figure shows a sample left pane of the Script Manager GUI:

Figure 28: Left Pane

4. Bottom Pane

This is also known as the Message panel where the debugging or information messages are displayed. The following figure shows a sample Bottom pane of the Script Manager GUI:

Figure 29: Bottom Pane

5. Right Pane

The right panel displays the content of the selected file from the left pane. The following figure shows a sample Right pane of the Script Manager GUI:

Figure 30: Right Pane