Script Utility Tools

Utility tools in Script Management enable a user to perform some specific actions on scripts and its recorded pages. In NetStorm Script Management, user can have the following Script Utility tools:

  • Split Page
  • Merge Page
  • Split Flow
  • Append Page
  • Delete Page
  • Rename Flow
  • Copy Flow
  • Copy Script
  • Create Script with WSDL

Split Page

The Split Page utility is used to split any inline or embedded URLs from a main URL and makes it a separate main URL. There may be cases when some inline URLs need to be treated as main URL, hence this tool is useful for the same. Splitting of a page can happen within a flow itself and only inline URL can be splitted.

Steps to split a page

  1. Launch Script Manager.
  2. Expand the Project, Subproject from the Left Pane.
  3. Select the script and then open flow file.
  4. Right click on any embedded URL inside the flow file and select Split Page option.

108

  1. Provide a name for the page to be splitted.

109

  1. Click the OK button, a new page is created with the same name provided while splitting, containing the splitted page as main URL.

110

Merge Page

The Merge Page utility is just the reverse of split page. In some cases, it might happen that some extra pages come after recording the scripts. In those cases, user might need to delete that page or a much better way is to merge the page with the page above it. Merging a page makes it the inline URL of the page above it. Merging can only happen for main URLs and also the very first page in the script cannot be merged.

Steps to Merge a page:

  1. Launch Script Manager.
  2. Expand the Project, Subproject from the Left Pane.
  3. Select the script and then open flow file.
  4. Right click on any main URL inside the flow file and select the Merge Page option.

As an example, user can merge the same page which is splitted in the Split Page section.

111

  1. An alert message pops-up for Confirmation. Click Yes.

112

  1. The page is merged to its previous page and appears in its inline URLs.

Split Flow

A user can split a flow file into two flows by right-clicking a page. The preceding pages are added in a new flow file.

Steps to split a flow:

  1. Launch Script Manager.
  2. Expand the Project, Subproject from the Left Pane.
  3. Open the script and then select the desired flow file in which the flow is to be splitted.
  4. Place the cursor at the specific page from where the new flow file is to be created.
  5. Right-click and select the Split Flow option.

6. This prompts for a new flow name.

7. Provide the flow name and click OK. It prompts for confirmation. Click Yes to split the flow.

8. This create a new flow file with the provided name. All the pages in the new flow are displayed in a window. The user can view and change the page names from here.

User can split the flow further in other flows by using the same approach.To view all the pages of all the flow files, click the Show All Pages button.

Append Page

Append Page utility is used to append pages from different flow files or different scripts. The appended page appears as the last page for the script.

Steps to Append a Page:

  1. Launch Script Manager.
  2. Expand the Project, Subproject from the Left Pane.
  3. Open the script and then select the desired flow file where pages need to be appended.
  4. Go to Edit menu and then select Append Page option.

113

  1. The Append Page dialog is displayed. Select Project, Subproject, Script Name from Source. Select the pages to append and provide a new name for the same.

114

  1. Click the OK button. A confirmation message is displayed. The selected pages are appended to the Destination script.

115

Delete Page

The Delete Page utility allows users to delete a page from scripts. In some cases, it might happen that some extra pages may come after recording the scripts. In those cases, user might need to delete that page from the script. Deleting can only happen if the script has more than one page because script having only one page cannot be deleted.

Steps to Delete a page:

  1. Launch Script Manager.
  2. Expand the Project, Subproject from the Left Pane.
  3. Select the script and then open flow file.
  4. Right click on any Page inside the flow file and select Delete Page option.

116

  1. An alert message pops-up for Confirmation of page deletion.

117

  1. Click the Yes button. The page is deleted from the script and a Confirmation Message is displayed.

118

Create Flow

The ‘Create Flow’ option is used to create a new blank flow in the script. On clicking this option, a pop up window is displayed in which the user can select a project name and a sub-project name to create a flow file in that script and add pages/URL transaction manually into the flow file.

Steps to create a flow

  1. Click the Create Flow option within the Edit menu.
  2. Provide the following details and click OK:
    • Flow Name
    • Project Name
    • Subproject Name
    • Script Name

Rename Flow

Rename Flow utility is used to rename that flow which is used in script. Rename flow can only applicable if the flow is not added in RunLogic.

Steps to Rename a Flow:

  1. Launch Script Manager GUI.
  2. Expand the Project, Subproject from the Left Pane.
  3. Open the script and then select the flow which is to be renamed.
  4. Go to Edit menu and then select Rename Flow option.

119

  1. The Rename Flow dialog is displayed. Give a new flow name, for example – RenameFlow.

120

  1. A confirmation message is displayed and flow file is renamed to the name provided.

121

Copy Flow

Copy Flow utility is used to copy flow from different scripts. The copied flow appears as the flow for the script.

Steps to Copy a Flow:

  1. Launch Script Manager.
  2. Expand the Project, Subproject from the Left Pane.
  3. Open the script and then select the desired Script where flow need to be copied.
  4. Go to Edit menu and then select Copy Flow option.

122

  1. The Copy Flow dialog is displayed. Select Project, Subproject, Script Name from Source. Select the Flow to copy and provide a new name for the same.

123

  1. Click the OK button. The selected flow is copied to the Destination script and Change Page names dialog box is displayed. User can change page names of the copied flow in script.

124

  1. User can see the copied flow in the script on Left Pane.

125

Copy Script

Copy script utility is used to copy Script from same or different Project and sub-project.

Steps to Copy a Script:

  1. Launch Script Manager GUI.
  2. Expand the Project, Subproject from the Left Pane.
  3. Open the script and then select the Script which is to be copied.
  4. Go to Edit menu and then select Copy Script option.

126

  1. The Copy Script dialog is displayed. Give the script name and choose destination Project name and Subproject name.

127

  1. Click the OK button. Copied script shows in destination Project and subproject. User can change the Page name of copied Script. User can see the copied Flow in the Project and subproject on Left Pane.

128

Create Script with WSDL

The Web Services Description Language (WSDL) is an XML-based language used to describe the services a business offers and to provide a way for individuals and other businesses to access those services electronically. It is the standard format for describing a web service.

Steps for Creating Script with WSDL

  1. On the Edit menu, click the Create Script with WSDL menu item. The following dialog box is displayed.

129

  1. Enter the Script name, project name, sub-project name, script type and WSDL path.
  2. Select the Proxy – No Proxy/System Proxy/ Manual Proxy.
  3. For manual Proxy, enter the Host and Port. User can also select the Proxy Authentication Credentials and provide the Username and Password.
  4. Click OK.

Get WSDL file from URL

User can specify file URL in the WSDL Path field in create script dialog. It fetches WSDL file from pasted URL. For getting WSDL, URL should be ended by ?WSDL. If user is fetching WSDL file from URL option, then user needs to support proxy to get WSDL file.

Get WSDL file from machine

User can specify file Path in the WSDL Path field in create script dialog or select path of WSDL file on the NS server. The selected file then be used to generate script. User needs to keep reference of file in script.

Capture Request and Response from WSDL file

User can get WSDL file from URL or from File. That WSDL file contains Header information of SOAP, Request, Response. WSDL file needs to parse to capture Header information of SOAP, Request and Response. WSDL file is parsed to obtain SOAP request envelops for each service.

Generate dump of Response

The captured SOAP envelops are to be sent in http request with sample inputs to generate sample response, which would be dumped.

Create Script

Use SOAP envelops to create flow file.

Sample Flow File

/*-----------------------------------------------------------------------------

Name: flow
Generated By: netstorm
Date of generation: 09/30/2017 03:14:53
Flow details:
Build details: 4.1.9. (build# 17)
Modification History:

-----------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ns_string.h"

 void flow()
{
  ns_web_url("GeoIPServiceSoap",
    URL=http://www.webservicex.net/geoipservice.asmx,
    Header=SoapAction:http://www.webservicex.net/GetGeoIP,
    Header=Content-Type:text/xml,
    BODY_BEGIN,
      "<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>
  <s11:Body>
    <ns1:GetGeoIP xmlns:ns1='http://www.webservicex.net/'>
<!-- optional -->
      <ns1:IPAddress>?XXX?</ns1:IPAddress>
    </ns1:GetGeoIP>
  </s11:Body>
</s11:Envelope>",
    BODY_END);

  ns_web_url("GeoIPServiceSoap1",
  URL=http://www.webservicex.net/geoipservice.asmx,
  Header=SoapAction:http://www.webservicex.net/GetGeoIPContext,
  Header=Content-Type:text/xml,
  BODY_BEGIN,
  "<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>
  <s11:Body>
  <ns1:GetGeoIPContext xmlns:ns1='http://www.webservicex.net/' />
  </s11:Body>
</s11:Envelope>",
    BODY_END);

 ns_web_url("GeoIPServiceSoap12",
    URL=http://www.webservicex.net/geoipservice.asmx,
    Header=SoapAction:http://www.webservicex.net/GetGeoIP,
    Header=Content-Type:text/xml,
    BODY_BEGIN,
      "<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'>
  <s12:Body>
    <ns1:GetGeoIP xmlns:ns1='http://www.webservicex.net/'>
<!-- optional -->
      <ns1:IPAddress>?XXX?</ns1:IPAddress>
    </ns1:GetGeoIP>
  </s12:Body>
</s12:Envelope>",
    BODY_END);

  ns_web_url("GeoIPServiceSoap13",
    URL=http://www.webservicex.net/geoipservice.asmx,
    Header=SoapAction:http://www.webservicex.net/GetGeoIPContext,
    Header=Content-Type:text/xml,
    BODY_BEGIN,
      "<s12:Envelope xmlns:s12='http://www.w3.org/2003/05/soap-envelope'>
  <s12:Body>
    <ns1:GetGeoIPContext xmlns:ns1='http://www.webservicex.net/' />
  </s12:Body>
</s12:Envelope>",
    BODY_END);
 }