<<

Essentials of Spirent TestCenter GUI to Automation

Introduction 1 Introduction Course Description

 The Essentials of Spirent TestCenter GUI to Script Automation Web-based course is designed to present an overview of the features and functions of the Save As Script menu item contained within the Spirent TestCenter GUI.

 Since it is a web-based course, you can choose to view only the topics of interest or the entire course.

 Viewing all the topics within the course will take just under 30 minutes.

Spirent Communications 2 Introduction Course Objectives  After completing this course, participants will be able to:

 Generate and run , Ruby, and scripts created using the Save As Script feature.

 Identify and describe the key elements contained with the files generated from the Save As Script feature.

 Describe the purpose of the Save As Script Additional Processing Options.

 Download and install HLTAPI.

 Generate HLTAPI scripts using the Save As Script feature.

Spirent Communications 3 Course Topics Overview

 Spirent TestCenter GUI to Script Automation Overview

 GUI to Script Content

 Additional Processing Options

 HLTAPI

Spirent Communications 4 Essentials of Spirent TestCenter GUI to Script Automation

GUI to Script Automation Overview 5 Course Topics Overview

 Spirent TestCenter GUI to Script Automation Overview

 GUI to Script Content

 Additional Processing Options

 HLTAPI

Spirent Communications 6 Spirent TestCenter GUI to Script Automation Overview GUI to Script Overview  The GUI to Script option enables automation on Spirent TestCenter without the typical automation overhead. Simply configure the within the GUI.

With the click of a button, generate the

Then execute the Test Script from a Shell.

Spirent Communications 7 Spirent TestCenter GUI to Script Automation Overview GUI to Script Benefits  Extremely easy to create Spirent TestCenter automated test configuration.

 Extremely easy to create a complete Spirent TestCenter automated test.

 Automation skills NOT required.

 Reduce time for writing a test case.

 Minimizing errors in writing test scripts manually.

Spirent Communications 8 Spirent TestCenter GUI to Script Automation Overview GUI to Script Limitations  Hard coded scripts.

 Must use the Sequencer in the GUI in order to have a complete Spirent TestCenter automated test.

Spirent Communications 9 Spirent TestCenter GUI to Script Automation Overview Spirent TestCenter Test Configuration

Spirent Communications 10 Spirent TestCenter GUI to Script Automation Overview Test Configuration Script Generation

Spirent Communications 11 Spirent TestCenter GUI to Script Automation Overview Additional Automation Processing Options*

Spirent Communications 12 Spirent TestCenter GUI to Script Automation Overview Naming the Scripts

Spirent Communications 13 Spirent TestCenter GUI to Script Automation Overview Generated Files  The Launcher script sources the Logic script.  The Logic script configures the test, executes the test, may send the traffic, may gather the results and disconnects from the chassis.  The XML file contains configuration data*.

Spirent Communications 14 Spirent TestCenter GUI to Script Automation Overview Executing a GUI to Script Test  You will execute your scripts generated by the GUI to Script feature from an environment Shell (Tcl/Ruby/Perl).  With Tcl for example, you can execute the Launcher script either from a DoS prompt: >tclsh .tcl >tclsh Save_Tcl.tcl  Or, from the Tcl Shell using the source command: % source .tcl % source Save_Tcl.tcl

Spirent Communications 15 Spirent TestCenter GUI to Script Automation Overview Script Results

Spirent Communications 16 Essentials of Spirent TestCenter GUI to Script Automation

GUI to Script Content

17 Course Topics Overview

 Spirent TestCenter GUI to Script Automation Overview

 GUI to Script Content

 Additional Processing Options

 HLTAPI

Spirent Communications 18 GUI to Script Contents GUI to Script Generated Files  Save As Script Menu item generates:  .tcl/pl/rb (Launcher file)  _logic.tcl/pl/rb (Logic file)  . (Configuration file)*.

Spirent Communications 19 GUI to Script Contents Logic Script

 Logic file contains the following procedures:  init - Sets logging level and file locations  configResultLocation - Sets the Results Location  configMiscOptions - Sets the Sequencer to Stop on Error  config - Defines configuration/Sets Port locations/Specifies the protocol stack linkages for both the blocks and any configured protocols  connect - Connect to the Chassis/Reserve Ports/Map Logical to Physical Ports  - Download the Test Configuration to the Chassis  run - Subscribe to Results/Start the Command Sequencer  cleanup - Release Ports/Disconnect from Chassis/Reset Configuration

Spirent Communications 20 GUI to Script Contents Configuration XML File

 When Configuration XML file is created:

 XML file contains all of the test configuration definitions.

 Logic Script contains all the same procedures (init, config, run, etc.), however, these procedures do not contain test configuration definitions since the definitions are passed from the XML file, making the Logic file much smaller in size.

 You can open the XML file in the GUI allowing a Script to GUI configuration.

Spirent Communications 21 GUI to Script Contents Launcher File  Launcher file:  Calls in the Logic script  Invokes procedures defined within the Logic script  Passes Chassis/Slot/Port List into the config procedure  Returns test status

Spirent Communications 22 Essentials of Spirent TestCenter GUI to Script Automation Additional Processing Options

23 Course Topics Overview

 Spirent TestCenter GUI to Script Automation Overview

 GUI to Script Content

 Additional Processing Options

 HLTAPI

Spirent Communications 24 Additional Processing Options Additional Automation Processing Options*

Spirent Communications 25 Additional Processing Options Script to Run Before Disconnect  Populating the Script to Run Before Disconnect will:  Run the stated script before the disconnecting from the Spirent TestCenter chassis.  Use these scripts to perform actions such as checking device status.

Spirent Communications 26 Additional Processing Options Prefix Procedures  Populating the Prefix Procedures with will:  Add stated name to prefix of all procedures within the Logic script.  Add stated name to prefix of all procedure calls within the Launcher script.

Spirent Communications 27 Additional Processing Options Encapsulate Procedures  Populating the Encapsulate Procedures in Namespace will:  Encapsulate all procedures within the Logic script.  Add stated namespace to the Launcher script.

Spirent Communications 28 Additional Processing Options Do Not Save Default Values  Unchecking the Do Not Save Default Values will:  Present all Objects within the Logic script.  Doubles the size of the Logic Script.

Spirent Communications 29 Additional Processing Options Use Default Values for Rarely Modified Settings  Checking the Use Default Values for Rarely Modified Settings will:  Further reduce the size of the Logic Script.

Spirent Communications 30 Additional Processing Options Save the Configuration Data in XML File  Using the Save the Configuration Data in Separate XML File will:  Create an XML File that contains the test configuration data.  Allows XML File to populate GUI.

Spirent Communications 31 Additional Processing Options Create Custom Launcher Script  If you use Create Custom Launcher Script you must:  Retrieve parameters using the following Tcl call: $stc::scriptParameters(-varName)

Spirent Communications 32 Additional Processing Options File Path Substitutions  Using Create basePathMap Variable with the Following Replacements will:  Allow you to create a Replace/With Table that is inserted into Launcher Script.

Spirent Communications 33 Essentials of Spirent TestCenter GUI to Script Automation HLTAPI 34 Course Topics Overview

 Spirent TestCenter GUI to Script Automation Overview

 GUI to Script Content

 Additional Processing Options

 HLTAPI

Spirent Communications 35 HLTAPI Spirent HLTAPI Description  Spirent HLTAPI (High Level Test API) is designed to hide the lower level of Spirent TestCenter. This greatly reduces the need for any test script changes if there are changes to Spirent's lower level APIs in newer releases.

 Spirent HLTAPI supports Tcl, Perl and Python. Depending on automation preferences or requirements, test specialists can use any of these languages for tests.

 Spirent HLTAPI is a self-contained package built on top of the Spirent TestCenter native API . In order to use the Spirent HLTAPI, the Spirent TestCenter native API library is required.

Spirent Communications 36 Install Spirent TestCenter HLTAPI Download Spirent TestCenter HLTAPI  Download the Spirent TestCenter HLTAPI from support.spirent.com

Spirent Communications 37 Install Spirent TestCenter HLTAPI Unzip HLTAPI  Unzip the downloaded HLTAPI package to a folder (such as :/HLTAPI_4.52_GA).

Spirent Communications 38 Install Spirent TestCenter HLTAPI Modify TCLLIBPATH

 Add the “C:/HLTAPI_4.52_GA/SourceCode” into the Windows Environment Variable TCLLIBPATH.

Spirent Communications 39 Install Spirent TestCenter HLTAPI Verify Installation  Launch a Tcl shell and type “package require SpirentHltApi”. The version information indicates that you have successfully installed HLTAPI.

Spirent Communications 40 Install Spirent TestCenter HLTAPI Register HLTAPI in Spirent TestCenter  To register the Save as HLTAPI tool in Spirent TestCenter:  Launch Spirent TestCenter. From the menu bar, select Tools > Options > Tcl/ to sure the Tcl/Tk installation path is correct (C:\Tcl).

Spirent Communications 41 Install Spirent TestCenter HLTAPI Register HLTAPI in Spirent TestCenter Continued  Launch the command line window and type the following command: tclsh C:\HLTAPI_4.52_GA\SourceCode\tools\toolRegister.tcl 4.56

 Ensure the . file (C:\HLTAPI_4.52_GA\SourceCode\tools) is NOT “Read-only”.

Spirent Communications 42 Install Spirent TestCenter HLTAPI Close Spirent TestCenter  Close Spirent TestCenter GUI.

 This completes the installation of the Spirent TestCenter HLTAPI.

Spirent Communications 43 Install Spirent TestCenter HLTAPI HLTAPI Documentation  HLTAPI Documentation is located in the folder of C:\HLTAPI_4.52_GA\UserDoc after HLTAPI installation.

Spirent Communications 44 Save as HLTAPI Wizard Launch the Save as HLTAPI Wizard  Open Spirent TestCenter.  In the menu bar, go to Tools > Custom Tools, and click Save as HLTAPI.

Spirent Communications 45 Save as HLTAPI Wizard Save as HLTAPI Wizard

Spirent Communications 46 Save as HLTAPI Wizard Save as HLTAPI Wizard Options  See Appendix A within the STC Automation HLTAPI Command Reference for definitions of the Wizard Options.

Spirent Communications 47 Save as HLTAPI Wizard HLTAPI Limitations

 The arguments of HLTAPI do not have a one-to-one correlation with Spirent Test Center's native API objects.

 Some functions and arguments are not supported by Save as HLTAPI. In these cases, you would have to modify the script manually.

Spirent Communications 48 HLTAPI for TCL Save as HLTAPI for Tcl  Select radio button HLTAPI for Tcl (default)

 Select the Browse button

 Select a file folder

 Select the Generate button

Spirent Communications 49 HLTAPI for TCL Save as HLTAPI for Tcl  Select Yes if you wish to view the generated script.

Spirent Communications 50 HLTAPI for TCL Execute HLTAPI Tcl Script  Make sure the test ports are available and source the generated script in Tcl shell: source Test_hltapi.tcl

Spirent Communications 51 HLTAPI for Perl Save as HLTAPI for Perl  Select radio button HLTAPI for Perl

 Select the Browse button

 Select a file folder

 Select the Generate button

Spirent Communications 52 HLTAPI for Perl Save as HLTAPI for Perl  Select Yes if you wish to view the generated script.

Spirent Communications 53 HLTAPI for Perl Setup HLTAPI Perl Execution Environment  Install Perl in a folder such as C:\Perl.  Copy the HLTAPI for Perl library files, hltapiserver.srv and sth.pm (from the SourceCode\hltapiForPerl folder) to your Perl library such as C:\Perl\site\lib.

Perl Library C:\Perl\site\lib

Spirent Communications 54 HLTAPI for Perl Setup HLTAPI Perl Execution Environment Continued  Add the variable value C:/Tcl/bin/tclsh (no quotation marks) into the Windows Environment Variable STC_TCL.

 HLTAPI Perl requires this environment variable.

Spirent Communications 55 HLTAPI for Perl Execute HLTAPI Perl Script  Make sure the test ports available and run HLTAPI for Perl script: perl Test_hltapi.pl

Spirent Communications 56 HLTAPI for Python Save as HLTAPI for Python  Select radio button HLTAPI for Python

 Select the Browse button

 Select a file folder

 Select the Generate button

Spirent Communications 57 HLTAPI for Python Save as HLTAPI for Python  Select Yes if you wish to view the generated script.

Spirent Communications 58 HLTAPI for Python Setup HLTAPI Python Execution Environment  Install Python in a folder such as C:\Python27.  Copy the HLTAPI for Python library files, hltapiserver.srv and sth.py (from \SourceCode\hltapiForPython) to your Python library such as C:\Python27\Lib.

Python Library C:\Python27\Lib

Spirent Communications 59 HLTAPI for Python Setup HLTAPI Python Execution Environment  Add the C:/Tcl/bin/tclsh (no quotation marks) into the Windows Environment Variable STC_TCL.  HLTAPI Python requires this environment variable.

Spirent Communications 60 HLTAPI for Python Execute HLTAPI Python Script  Make sure the test ports available and run HLTAPI for Python script: python Test_hltapi.py

Spirent Communications 61 Thank You

spirent.com

© Spirent Communications, Inc. All of the company names and/or brand names and/or product names and/or logos referred to in this document, in particular the name “Spirent” and its logo device, are either registered trademarks or trademarks pending registration in accordance with relevant national laws. All rights reserved. SpecificationsSpirent Communications subject to change without notice 62