How to Use the Scripting Tool

Last Updated: 2011-06-23

The scripting tool is designed to automatically create short scripts (or macros) for you based on the attributes and settings you have configured for a specific activity in the Interactive Testing tab. It is possible to create complex scripts directly in the scripting tool. However, if advanced scripts are needed, to control a .dll for your wireless device for example, you may prefer Visual Basic in the .NET programming environment to create the script as it provides many more tools than are provided in the scripting tool to help you create advanced scripts. You can import any .NET script into the scripting tool.

This topic discusses the following:

Using toolbar icons in the scripting tool

Once the scripting tool is open, a screen similar to the one below should appear. The toolbar contains the basic printing and editing options as well as basic programming options such as commenting/un-commenting a selection of code, adding bookmarks, and displaying information such as the object member list.

Scripting tool toolbar icons (top of scripting tool):

Intellisense features:


Scripting tool menu items


This menu allows several of the standard File menu items including: Print..., Print Preview..., Page Setup... , and Exit .


This menu allows several of the standard Edit menu items including: Undo, Redo, Cut, Cut/Append, Copy, Copy/Append, Paste, and Delete.

Additional menu non-standard menu items include:




The Control column (on the left side of the screen) shows the following:

Four main control buttons for the selected script:

Activity Logging:

Continuing down the Control column, the following options are available in the scripting tool to help you manage the scripts listed in the bottom portion of the Control screen:

The bottom portion of the Control column is a complete list of the wireless devices you have added to the Interactive Functional Test Software along with submenus of the format(s) they support (see How to Add a DUT). In each format submenu for the wireless device is a list of any available script files for that device and format. The available script files can also be organized into groups. You can move scripts and groups of scripts to different wireless devices by dragging and dropping them with your mouse.

Notice that some of the items in the list have a tan background and some do not. The items without a tan background apply to the Current DUT and Current format.

Creating scripting tool files

The most common way to create a script is to allow the Interactive Functional Test Software to automatically create scripts based on your current settings. It is possible to create complex scripts manually in the scripting tool, however it is recommended that it only be done by advanced users who are familiar with the programing in the Visual Basic .NET environment.

Note: scripting tool files are created and edited in the Script Code tab of the scripting tool. For information on how to send results from the scripting tool files to the Text Results and Image Results tabs, respectively, see using the Text Results and Image Results tabs in the Scripting tool.

To create a script file:

  1. Open the scripting tool by clicking the scripting tool icon in the tool bar, scripting.jpg.

  2. In the Interactive Functional Test Software Scripting Tool window, create a new script by clicking Scripting_Tool_NewFile.jpg. This will prompt you for the script name and the group name (if any) that you would like to associate the script with. The new script is added to the list of scripts for the wireless device selected as the Current DUT and in Current Format submenu. If necessary, add a comment to help distinguish the script file.

  3. In the N5970A Interactive Functional Tester window (the main window):

  1. In the Interactive Testing tab, or any other parameter that has a blue arrow next to it, and choose the activity you want to create a script for.

  2. Click and hold the blue arrow, ScripterArrow.jpg, next to the action you want the script to perform. (If the scripting tool is not yet opened, clicking on the blue arrow will also open it.)

  3. Then, drag your cursor from the Interactive Functional Test Software main window to the Scripting Tool window appropriate place between the "Public Sub ScriptEntry" declaration and the "End Sub" (for Script Entry) in the scripting tool. Automatically generated functions are listed below the subroutines and are collapsed.

  4. Repeat steps a through c for any other activity you want to add to the script file.

  5. In the Interactive Functional Test Software Scripting Tool window, expand the automatically generated functions and change parameters as necessary.


    When a script is run, parameters that are changed in the scripting tool are also changed in the Interactive Functional Test Software's main window, not vice versa.


  6. There are several code snippets available to you if you need to add to your script file. To view the available snippets, right-click in the script file and select Insert Snippet.


    To view Visual Basic's Intellisense feature, which is a list of all the object members available for the specific item, type in "me." in the entry point subroutine called "ScriptEntry"and the list should display.

    If the attributes have Wait for continue selected, you can press continue either in the scripting tool or the Interactive Testing screen of the Interactive Functional Test Software.

    The above figure is just an example of the many snippets available to you. You can also perform any command that you can perform from the command line screen, such as ping, within the Scripting tool (this can be done using the snippet N5970A>>Command Line Control).

  7. Test the script file by clicking the Run button in the Interactive Functional Test Software Scripting Tool window. The Activity tab on the Interactive Functional Test Software main window displays the activities that are started from the script file. Also, the Interactive Functional Test Software's title bar also indicates that a script is currently running.


    The non-time limited activities, which are Network Impairments and Battery Profile, will terminate when a script file ends. This is regardless of whether the non-time limited activity was initiated in or before any script file.


This example creates a script to send two SMS message to the wireless device (SMS to DUT) with a 1 second delay between sending the messages. The setup is shown in the figure below. Not shown is the Text for Message 2, which is "text for message two".


To create a script that sends the selected messages in the Check message(s) to send, that also has the same attributes and settings that have been configured:

The resulting script is shown below. A comment was added directly into the Comment tab window. This comment is displayed in the test step information column in the Stress Testing tab.


For more information on creating scripts, see How to Create Advanced Scripting Tool Files.

References the Interactive Functional Test Software imports into the scripting tool

The references that are automatically imported into the Scripting Tool for you to use are:

  1. System

  2. System.Collections.Generic

  3. System.IO

  4. System.Windows.Forms

  5. System.Drawing

  6. System.Diagnosis

  7. Microsoft.VisualBasic

  8. Agilent.ModelN5970A

The scripting tool allows you to add more references for writing more advanced scripts. To find out how, see How to Add an Advanced Reference to the Scripting Tool.


Related Topics