124

Click here to load reader

HIT Training

Embed Size (px)

DESCRIPTION

NSN HIT training

Citation preview

Page 1: HIT Training

NOKIA

HIT(Holistic Integration Tester)

2005-09-27

Presented by:Roland Tóth NET/Budapest

Page 2: HIT Training

NOKIAInstructor:

Tóth Roland

Senior Software Verification Engineer

(NET R&D / Budapest)

NMMITHU8

Page 3: HIT Training

Agenda: Time range : 9:00 – 12:00

• Part 0: Beginning / Introduction• Part 1: General information• Part 2: Devices• Part 3: Hit language• Part 4: Functions• Part 5: Error• Part 6: Debugger• Part 7: Response analysis• Part 8: Caselist & Batchqueue• Part 9: Options• Part 10: DLL & DDE

Time range: 12:00 – 13:00 LunchTime range: 13:00 – 15:00

• Part 11: Exercise / Practising

Page 4: HIT Training

Part 1:General Information

Page 5: HIT Training

Agenda

• Background• Main Features• How to use HIT • User Interface• Toolbar• Toolbar Dialog• On-line Help

Page 6: HIT Training

Background

• HIT = Holistic Integration Tester

• Automated test execution • First version was released in 1994• Implemented for integration testers of MSC&HLR

product line

Used also • in other product lines• to cover complete testing area

Page 7: HIT Training

General Information

• Main part of the customer tool package• (HIT, TICA, DXDOS)

• Latest release version 2.8-0• You can download from the Main HIT macrosystem

page

http://wwwalltr.ntc.nokia.com/MSCHLR/msys/

Page 8: HIT Training

8 . dia INFO NAP 2002 Roland Tóth from NOKIA

Introduction

Capabilities of the HIT:

· Test Execution Language TEL· connection to DX using COM-ports· TELNET sessions to UNIX workstations using TCP/IP· Automatic macro execution and result analysis

· online help system, example macros, copy&paste library

· debugger features: breakpoints, single stepping, active variables

· message monitoring support· charging and statistics reports· module testing support

· DDE / DLL interface

Page 9: HIT Training

Main Features

HIT

TEL-language

Serial port and TCP/IP connections

Device control

Queueing mechanism

Debugger features

Automatic macro execution

Result analysis

Extensible with DLLs

Use of DDE -functions

Case list features

System function libraries

Page 10: HIT Training

Concepts• Macro A logical functionality written

in TEL- language (e.g a test case or a macro for

other purposes)• Case list A list of macros to be

executed in given order, can be saved in a list file

• Library Collection of functions written in the HIT language

• Batch A group of HIT macros or case lists that are executed when batchqueue is started.

Page 11: HIT Training

What Must Be Tested -1• One Network Element must be tested without other

network elements

Page 12: HIT Training

How It Is Tested in Principle -2

• Other network elements are simulated. • Different simulators are co-ordinated from HIT master

tester. • In addition, HIT initialises the network element under

test Holistic Integration Tester (HIT)

HLRSimulation

SCPSimulation

PSTNSimulationMSC

PBXSimulation

A-InterfaceSimulation(MS+BSS)

Page 13: HIT Training

User Interface

Macro

Response

Messages

List

Page 14: HIT Training

Toolbar

New File

Open

Replace File

Save

Undo

Cut

Copy

Paste

Find

Find Next

Replace

Fast Mode

Syntax Check

Run

Stop

Reset

Send Next

Skip

Goto

Run To Cursor

Step Over

Trace Into

File actions Text actions Debugger actions

Page 15: HIT Training

Toolbar Dialog

Send NextSkipGotoRun To CursorStep OverTrace IntoSend BreakPrintPrint PreviewAdd WatchView WatchCall StackTerminal 1Terminal 2Terminal 9User Help 1User Help 2User Help 9

Available only in HIT versions 2.2-0 or later.

Possibility to insert to the Main Window Toolbar:

Page 16: HIT Training

On-line Help• System Functions Help for HIT system functions

• Language Reference Help for TEL language

• Debugger features Debugger features and possibilities in HIT

• SW Upgrade Project Help for creating a SW upgrade project and its files

• HIT environment

• Getting started Help for basic functionality

• Caselist options

• HIT limitations

• Emergency Help

Page 17: HIT Training

Summary

• Main features of HIT• Automatic macro execution• Result analysis• Device Control• Extensible with DLLs• System function libraries• Debugger Features• TEL-language

• Macro is a logical functionality written in TEL-language

• Hit supports TCP/IP and RS-232 communications

Page 18: HIT Training

Part 2:Device

Page 19: HIT Training

Part 2: Agenda

• Background on devices• Device System Functions• Device Configurations

• Com Connections• Telnet Connections• Prompts• Login• Resurrection• Terminal• Miscellaneous• Configurations

• Connect

Page 20: HIT Training

Device

• Devices enable the testing of objects that are not located in the HIT PC

• The HIT system provides an easy interface with Devices

• Devices must be connected to the HIT PC with either RS-232 COM ports or TCP/IP telnet connections

• Information is stored in the HIT2.INI file and read whenever the program is started

Page 21: HIT Training

Device Configurations

User may create, edit or delete Telnet and COM -connections

List of defined connections for the system is shown here

Page 22: HIT Training

COM Connection

Page 23: HIT Training

Telnet Connection

Page 24: HIT Training

Prompts

Three separate prompts for each device may be defined. The function must be given one of the index of the prompt being specified, either 1, 2, or 3, and the string representing the desired prompt for the unit.

• BOTH, wait for prompt before and after sending a command

• BEFORE, wait for prompt before sending, no waiting for prompt after command has been send

• AFTER, wait for prompt after command has been send, no check before sending command

• NONE, just send the command, regardless if a prompt is available

Page 25: HIT Training

Login

Page 26: HIT Training

Resurrection

Page 27: HIT Training

Terminal

Page 28: HIT Training

Miscellaneous

Page 29: HIT Training

Configurations

All the defined connections for the system will be shown here

If the connection is not currently in use (used by a macro or have a window open), the status is closed

Page 30: HIT Training

30 . dia INFO NAP 2002 Roland Tóth from NOKIA

INI files storing place and change method

The INI files stores the settings which describes the connections between the PC and the tested system, and this connection settings. This INI files may contain also COM and TELNET session settings also.

This INI files are checking by the LAB guys, and stored in a common place.

INI file storing on the C drive is forbidden.

You can use only from the Y drive only.

The path : Y:\Int\Ini_files\

If you would like to change it, then you can set it in the following menu place:

Device Set configuration Configuration File Browse

Page 31: HIT Training

Summary

• Hit enables an easy way of controlling devices• Devices connected to HIT PC with RS-232 COM

ports or TCP/IP socket links• Device system functions

• e.g.• device() - The device function is used to select the device with

which the system communicates.• Tx() - sends formatted output to a device, statements can be

transmitted to the currently open device.

• The user can define three prompts and four revivals for the device

• Toolbox • user specified tool-buttons for frequently used activities

Page 32: HIT Training

32 . dia INFO NAP 2002 Roland Tóth from NOKIA

Toolbox

User can create tool-buttons for frequently used activities

Select the button and the command type

Page 33: HIT Training

Part 3:HIT Language

Page 34: HIT Training

Agenda

• Writing Macros• HIT Macro Language (TEL)• Variables

• Referring to Variable Values

• Arrays• Control Statement

• If, While, For, Switch, Break and Abort

Page 35: HIT Training

Writing Macros

• Design like programs

• Structure as simple as possible• functions and function calls• comments!!!

• Frequently used functions can be stored in libraries

• One macro may contain several functions

• Syntax highlighting

Page 36: HIT Training

HIT Macro Language (TEL) /1

• Comments: /* */ , // , :• Continuation: \• Assignment: =• Comparison: ==, <>, >, >=,

<, <=• Math: +, ++, -, --, *, / • Logical: AND, OR, NOT• Bitwise: &, |, ~, ^, <<, >>• Substring: ” ‘…’ ” in search

expression

Page 37: HIT Training

37 . dia INFO NAP 2002 Roland Tóth from NOKIA

HIT Macro Language (TEL) /2

• #include• #define• #incpath

• Hasoption() detection function for used own option string detection

• E.g. > #option /test

Page 38: HIT Training

Variables• Variable definition and assignment

• scope type variable_name = assignment;

• Types:• integer, float, string

• Scope:• public, const, perm (export variable),

extern (import variable)• integer x; • string y; • integer VariableArray[];

• x = 4;• y = "HIT";• VariableArray[4] = 123;

Page 39: HIT Training

Referring to Variable Values

• %s string • %d integer• %f float

• A format specifier begins with a percent sign and is followed by the format code

• There must be exactly the same number of arguments as there are format specifiers

• Format specifiers and the arguments are matched in order from left to right

• e.g. print("I am %d %s", ‘28', "years old");

Page 40: HIT Training

Arrays

• scope type arrName[dimension_size];

• dimension_size can be either:• fixed: [12] as in traditional arrays • unfixed:[] ; this is HIT associative array

• traditional arrays may be indexed from 1 to dimension_size as normally

• associative arrays may be indexed arbitrary• Multidimensional arrays

• scope type multiArrName[ ][ ]

Page 41: HIT Training

Example Traditional Array

function seasons()string myArray[4];integer i;

myArray[1]="Summer";myArray[2]="Autumn";myArray[3]="Winter";myArray[4]="Spring";

for(i=1; i<=4; i++)print("%s\n", myArray[i]);

endforendfunction

Page 42: HIT Training

Example Associative Array

function translateEnglishSeasonNamesIntoFinnish()string dictionary[];string question;

dictionary["summer"]=”nyar";dictionary["autumn"]=”osz";dictionary["winter"]=”tel";dictionary["spring"]=”tavasz";

ask(question, "Give Season name in Hungarian");messagebox(dictionary[question]);

endfunction

Page 43: HIT Training

Control StatementsIF

if( x < 100)

y = 2;

elseif( x > 100 AND x < 200 )

y = 3;

else

y = 4;

endif

Page 44: HIT Training

Control StatementsWHILE

while( Y < X )

print( "Number Y is: %d\n", Y );

Y++;

endwhile

Page 45: HIT Training

45 . dia INFO NAP 2002 Roland Tóth from NOKIA

Control StatementsDO

Integer x = 10;

Integer y = 1;

do

print( "Number Y is: %d\n", Y );

Y++;

until ( Y < X )

Page 46: HIT Training

Control StatementsSWITCH

switch( UnitName )case( "LSU" ):case( "CCSU" ):

print( "Signaling unit selected" );break;

case( "OMU" ):print("Operational and Maintenance unit

selected");break;

default:print( "Some other unit" );break;

endswitch

Page 47: HIT Training

Control StatementsBREAK

while ( i < 100 )

status = DoSomething();

if ( status == FALSE )

break;

endif

endwhile

If ( status == FALSE ), execution is continued after endwhile despite the value of i.

Page 48: HIT Training

Control StatementsABORT

function main()

integer nbr;

nbr = ask(“Input case number”);

if(nbr == CANCEL)

printlog(“Paranormal ending\n”);

abort ( 0,”Stop macro” ); /* terminate macro */

else

ExecuteCase(nbr);

endif

endfunctionIf ( nbr == CANCEL ), macro execution is terminated

Page 49: HIT Training

49 . dia INFO NAP 2002 Roland Tóth from NOKIA

Control StatementsRETURN

• The user can use the RETURN controlling statement in the function calls.

• If this statement has invoked in any place in the function the execution is stopped at this point, and the function return with this parameter value.

Page 50: HIT Training

Summary

• TEL-language is a procedural language• Over 200 system functions• Macros designed like programs• Macro structure: functions and function calls• First function always the main function• Traditional arrays: a static array, fixed dimension

size, indexing from 1 onwards• Associative arrays: a dynamic array, unfixed

dimension size, indexing arbitrary • Control statements: if, while, switch, for, break,

abort

Page 51: HIT Training

Part 4:Functions

Page 52: HIT Training

Agenda

• Definitions of Functions• HIT System Functions• User Specified Functions• Toolbox

Page 53: HIT Training

Functions

FUNCTIONS

User's SpecifiedFunctions

HIT SystemFunctions

Parameterspass by

reference

Functionreturning a

value

Parameterspass by value

Page 54: HIT Training

HIT Example System Functions

• device( "MML" );• tx( "ZUSI:COMP::LIST;" );

• Also embedded tx commands, Z...• Automatic MML-semantic error detection

• getline( line," 'WO-EX' " );• strfetch( line, "12-13", str1 );• strscan( line, "%s %d %*s %s",str1, int1,

str2 );

7 tips for string manipulation:

Microsoft PowerPoint

bemutató

Page 55: HIT Training

HIT System Functions

• User Interface functions ask ()

• Analysis and log handling functions getline ()

• File Functions fileread ()

• String manipulation functions strfetch ()

• Conversion functions inttostr ()

• Time functions getpctime ()

• Device Functions promptcheck ()

• DDE functionsused with external

applications• DLL functions

dllload ()• FTP functions e.g.

used in M9• Directory Functions

getworkdir ()• Miscellaneous Functions• Event handler functions

(eventsetstate( ) )• (Obsolete functions)

Page 56: HIT Training

Functions:Parameters Pass By Reference

function a()

integer a = 1;

b(a);

//value of a is changed to 2

endfunction

function b( integer &param )

param = param +1;

//value of param is 2

endfunction

Page 57: HIT Training

Functions:Parameters Pass By Value

function a()

integer a = 1;

b(a);

//value of a is unchanged

endfunction

function b( integer param )

param = param +1;

print("%d",param);

//value of param is 2

endfunction

Page 58: HIT Training

Functions:Function Returning a Value

function math()

integer a = 3 , b = 5, c;

c = CountSum(a,b); // value of the c is now 8

endfunction

integer function CountSum( integer x, integer y )

return( x + y );

endfunction

Page 59: HIT Training

File reading

Functions:• Fileopen integer handle fileopen(string

filename, integer option);• Filegetline integer filegetline( integer

handle, string line, ["search criteria"], [variable..])

• Fileclose fileclose(integer handle);

Page 60: HIT Training

60 . dia INFO NAP 2002 Roland Tóth from NOKIA

String functions /1

• Strfetch

• integer strfetch (string line, "search criteria", string ...)

• f.g. integer count;string line = "My name is Roland and I am 26 years old",

name;{count = strfetch (line, "12-17", name);}

{count = strfetch (line, „’am’:4-5", name);}

Page 61: HIT Training

61 . dia INFO NAP 2002 Roland Tóth from NOKIA

String functions /2

• Strscan

• integer strscan(string str, "[%s]... [%f]...[%d]...", [string], [float], [integer]...)

• f.g. integer age, count;string line = " My name is Roland and I am 26 years old",

name;{count = strscan (line, "%*s %*s %*s %s %*s %*s %*s %d",

name, age);}

Page 62: HIT Training

62 . dia INFO NAP 2002 Roland Tóth from NOKIA

String functions /3

• integer strregexp(string line, string regexp)

Search for substring matching the regular expression (search criteria)

• ".„ matches any single character• "[aeiou]" would match either "a", "e", "i", "o", or "u".• "[ a-z ]" would match on any lowercase alphabetic character• "[ ^g-v ]" would match on any lowercase alphabetic character

NOT between g and v.• "[ a-z ]*" matches zero or more occurrences of lowercase

alphabetic characters.• "[ 0-9 ]+" matches one or more occurrences of lowercase

alphabetic characters.• "xy?z" matches on "xy" or "xyz".• "^[ A-Z ][ a-z ]*" matches capitalised words at the beginning of a

line.• "[ A-Z ][ a-z ]*$" matches capitalised words at the end of a line.

Page 63: HIT Training

63 . dia INFO NAP 2002 Roland Tóth from NOKIA

String functions /4

• Substring search with any position in the string

Example:Getline(line,” ‘searched substring’ ”);

• More criterias in searching criteria:

Example:Getline(line,” ‘substr1’ AND ‘substr2’ OR ‘substr3’ ”);

Page 64: HIT Training

64 . dia INFO NAP 2002 Roland Tóth from NOKIA

String functions /5

• Whitespace and continuation:

Example:

line = ”\” string\””; > “ in the string

It should be used if put directory part with spaces:

dir = “\”C:\Program Files\Hit2\”\”;

line = ”\n new line \t: tab”; > new line and tab

Page 65: HIT Training

65 . dia INFO NAP 2002 Roland Tóth from NOKIA

String functions example macro

function main()integer fhand;string line;

fhand = fileopen("exercise.log",READ);if(fhand<0)

abort(0,"file not found"); endif

while(getline(line,"'WO-EX'" ))strscan(line,"%s %*s %*s %*s",unit);fileprint(fnum,"%d.: %s\n",i,unit);

endwhile

fileclose(fhand);endfunction

Page 66: HIT Training

66 . dia INFO NAP 2002 Roland Tóth from NOKIA

Functions:Passing Traditional Array as an

Argumentfunction seasons()

string myTradArray[4];integer i;

myTradArray[1]="Summer";myTradArray[2]="Autumn";myTradArray[3]="Winter";myTradArray[4]="Spring";

printTradArray(myTradArray, 4);endfunction

function printTradArray(string myArray[*], integer size)integer i;for(i=1; i<=size; i++)

print("%s\n", myArray[i]);endfor

endfunction

Page 67: HIT Training

67 . dia INFO NAP 2002 Roland Tóth from NOKIA

Functions:Passing Associative Array as an

Argumentfunction translateEnglishSeasonNamesIntoHun()

string dictionary[];

dictionary["summer"]=”nyar";dictionary["autumn"]=”osz";dictionary["winter"]=”tel";dictionary["spring"]=”tavasz";

askAndTranslate(dictionary);endfunction

function askAndTranslate(string dictionary[])string question;

ask(question, "Give Season name in english");messagebox(dictionary[question]);

endfunction

Page 68: HIT Training

Summary

• Division to user specified functions and system functions

• User specified functions are divided in to three categories

• parameters pass by reference• parameters pass by value• functions returning a value

• Hit has a very extensive system functions help• system functions e.g. log handling functions, file functions

Page 69: HIT Training

69 . dia INFO NAP 2002 Roland Tóth from NOKIA

BATCH LIST MACROSTATEMENT

ASSIGNMENT

DATA

DIALOG

DESKTOPSETTINGS

RESP ANA

FUNCTION

FLOW CONTROL

OPTIONS

SENDPORTSETTINGS

OUTPUT

WINDOWFILE

PORT

devicequestionanswersuffixtimeoutsetdelaygetdelay

controlled by

COM

TCP / IPinternalexternal

logmonitoring

responseterminal

getlinestrfetchstrscan

askmenupause

simplearray

constvar

calls calls

has

calls is

is

is

is

using

hasusing

is

goes to goes to

has

giving

if-else / for / while

monitoringchargingstatisticscomplogs

is

is

checking

HIT object model

string / conv / file / time

is

sendtx

Page 70: HIT Training

70 . dia INFO NAP 2002 Roland Tóth from NOKIA

HIT SCHOOL

Page 71: HIT Training

71 . dia INFO NAP 2002 Roland Tóth from NOKIA

Hit Advanced Modules

• Errors• Debugger Features• Response Analysis • Lists&Batchqueue • Options• DLL

Page 72: HIT Training

72 . dia INFO NAP 2002 Roland Tóth from NOKIA

Repeating - Concepts

• Macro A logical functionality written in TEL- language (e.g a test case or a macro for other purposes)

• Case list A list of macros to be executed in given order, can be saved in a list file

• Library Collection of functions written in the HIT language

• Batch A group of HIT macros and/or case lists that are executed when batchqueue is started.

Page 73: HIT Training

73 . dia INFO NAP 2002 Roland Tóth from NOKIA

Part 5:Errors

Page 74: HIT Training

74 . dia INFO NAP 2002 Roland Tóth from NOKIA

Agenda

• Error Types• Error Handling• Runtime Error Recovery

Page 75: HIT Training

75 . dia INFO NAP 2002 Roland Tóth from NOKIA

Errors

Errors

Syntax Check Runtime

Missingsemicolon

Invalidassignment

Systemfunctions

Expressions

Invalidparameter

values

Invalidstring

"Device notselected"

"Device notfound"

Uninitializedarray

Index

Uninitializedvariables

Table

Invalid functionparameter

types

Device

Logical Errors

Page 76: HIT Training

76 . dia INFO NAP 2002 Roland Tóth from NOKIA

Error Handling• Runtime errors

• System function evaluation error

- Recovered by the choice "Recover Runtime errors"

• An evaluation error of a sentence

- Division by zero• Other errors (not handled by the HIT)

- Disk is full • Controlled by the "Recover Runtime Errors"-choice

- In DX200 integration testing nothing is allowed to stop the executing of the list/batchque!!!

Page 77: HIT Training

77 . dia INFO NAP 2002 Roland Tóth from NOKIA

Recover Runtime Errors• Error handling on

•Notification to the user, the user may try to correct the macro and continue the run

• Error handling off•Macro execution stops and notification is sent to the user, the next macro on the list/batch on the run

• Errors, which cannot be corrected•DDE/DLL System functions

• - Invalid function prototype in dll-function call -> runtime error (unrecoverable)

• - Invalid parameter value in DLL-function call ->crash

• - Invalid DDE parameters may cause the Server application to abort ongoing DDE transaction

•String to number conversion•The system crashes

Page 78: HIT Training

78 . dia INFO NAP 2002 Roland Tóth from NOKIA

Summary

• Three types of errors (errors in macros)• Runtime Errors• Syntax Check Errors• Logical Errors

• Error handling• Recover runtime errors -option allows the user to do

corrective actions without restarting the macros

Page 79: HIT Training

79 . dia INFO NAP 2002 Roland Tóth from NOKIA

Part 6:Debugger

Page 80: HIT Training

80 . dia INFO NAP 2002 Roland Tóth from NOKIA

Agenda

• Introduction• Run Menu Choice • Debugger Menu Choice• Breakpoints• Active Variables

Page 81: HIT Training

81 . dia INFO NAP 2002 Roland Tóth from NOKIA

Debugger

• Debugger features help to control macro execution

•- Enable user to set breakpoints•- Provide on-line information of values of variables and function call stack

Page 82: HIT Training

82 . dia INFO NAP 2002 Roland Tóth from NOKIA

Run

Execution mode

Syntax check for a macroStart macro or caselist execution

User event calling

Page 83: HIT Training

83 . dia INFO NAP 2002 Roland Tóth from NOKIA

Debugger

Call Stack

Active variablesWatch

Breakpoints

Page 84: HIT Training

84 . dia INFO NAP 2002 Roland Tóth from NOKIA

Breakpoints

Set the breakpoint to the certain line by setting the cursor on the line and selecting Toggle breakpoints from debug-menuBackground of the line turns to red

• Macro execution will be interrupted at that line

• Continue execution by stepping (line-by-line) or by running• Removing breakpoints

Line-by-line: Select Toggle breakpoints

All at once: Select Clear all breakpoints

Page 85: HIT Training

85 . dia INFO NAP 2002 Roland Tóth from NOKIA

Active Variables• List is a dialog showing variables that are

currently active

• List consist of• - type of the variable• - name of the variable• - current value

• Value can be changed by • double clicking the variable

Page 86: HIT Training

86 . dia INFO NAP 2002 Roland Tóth from NOKIA

Other Debugger FeaturesProvide on-line

information:

• Watch properties • - Variables can be hand-

picked into a watch window

• Call stack• - Window showing the

function calls and their arguments

Page 87: HIT Training

87 . dia INFO NAP 2002 Roland Tóth from NOKIA

Summary

• Debugger features available only in the interactive mode

• Debugger features enable the controlling of the macro execution

• Examples on debugger features • breakpoints: macro executed will be interupted at a

breakpoint line• active variables: dialog showing variables currently active

Page 88: HIT Training

88 . dia INFO NAP 2002 Roland Tóth from NOKIA

Part 7:Response Analysis

Page 89: HIT Training

89 . dia INFO NAP 2002 Roland Tóth from NOKIA

Agenda

• On-line and Off-line response analysis• Event-Handler Structure• Log-files• File Handling and Log Handling system

functions

Page 90: HIT Training

90 . dia INFO NAP 2002 Roland Tóth from NOKIA

Log Files

• HIT creates <LogName>.log file always when HIT macro or list is run. <LogName> means either:

• macro file name, • test case name in the list window, or• list name if test case names are not given

in list window for macros• Log file may be changed using logset system

function. Logclose return the original• Log file includes

• All responses from response window• All logprint function outputs• All HIT system outputs

Page 91: HIT Training

91 . dia INFO NAP 2002 Roland Tóth from NOKIA

File Functions & Log Handling Functions

File Handling Functions

• Opens a file to be used by a macro file

• Returns a handle to this file

• Referring to the file the user needs to specify the handle

Log handling functions

• Opens a file to be used by the macro

• Hides the handle from the user

• Automatically refers to the file the user doesn't need to specify the handle

Page 92: HIT Training

92 . dia INFO NAP 2002 Roland Tóth from NOKIA

Differences between file- & log handling functions

• File functions

+ If more than 1 files to be analyzed simultaneously

- The abstract handlers

• Log handling functions

+ No handlers

- Complicated when more than 1 files to be analyzed

Page 93: HIT Training

93 . dia INFO NAP 2002 Roland Tóth from NOKIA

File System Functions

Function Descriptionfileaccess Determine existence of the specified file or directoryfileclose Close a file. filecopy Copies specified filefiledelete Delete a filefilegetline Search and read from a file. filegetpos Return current file pointer positionfileopen Open a file. fileprint Formatted output to a file. fileread Read from a file. filereceive Receive files from connected device using Kermit protocolfileseek Position the access point in a file to top or bottom or current filesetpos Sets file pointer positionfilesize Get file sizefiletransmit Send the specified file to the remote device using Kermit protocol

Page 94: HIT Training

94 . dia INFO NAP 2002 Roland Tóth from NOKIA

Log Handling Functions

Function Descriptiongetline Read or seek line from the log stream.getlogname Get the name of the current log file.Logclose Close log file. logcloseaux Close an auxiliary log filelogenable Toggles logfile writing logfilter Turns (escape character) filtering ON/OFFlogprint Write to log file and to message window. logscreen Writes last n lines from screen buffer to the current log filelogseek Position the internal log pointer to top or bottom of log or to last.logset Open log file. logsetaux Open auxiliary log filelogsize Gets the specified log size.logwaitline Same getline() except it doesn't return until complete line is read

Page 95: HIT Training

95 . dia INFO NAP 2002 Roland Tóth from NOKIA

File open and positioning example:

function main()

integer file_handler;

file_handler = fileopen("params.par",READ);... fileclose(file_handle);

endfunction

Positioning in the file can do with >fileseek(Handler,FILE_BEGIN);fileseek(Handler,FILE_END,-1);fileseek(Handler,FILE_CURRENT,2);

Page 96: HIT Training

96 . dia INFO NAP 2002 Roland Tóth from NOKIA

Log open and positioning example:

function main()

logprint("This goes to standard out of the test system");

logset("temp.out", NEW);

logprint("This goes to temp.out");

logclose();

endfunction

Positioning in the log can do with >logseek(LAST,2);logseek(CURRENT,1);

BOTTOM end of the log file.LAST start of last command's output.CURRENT current position.

Page 97: HIT Training

97 . dia INFO NAP 2002 Roland Tóth from NOKIA

Summary

• Hit enables the user to do • On-line Analysis

– HIT is told to follow the response continuously during the macro execution

– Event-Handler structure, Log-handling and File system functions

• Off-line Analysis– The response is saved in files and analysed later– Log-handling and File system functions

Page 98: HIT Training

98 . dia INFO NAP 2002 Roland Tóth from NOKIA

Part 8Caselists & Batchqueue

Page 99: HIT Training

99 . dia INFO NAP 2002 Roland Tóth from NOKIA

Agenda

• Macrolist• Definition of a Batchque

Page 100: HIT Training

100 . dia INFO NAP 2002 Roland Tóth from NOKIA

Building Test Suite with Caselists

• Test suite = grouping of related macros into caselist

• List provides a common interface to a collection of macros

• List window for writing and running caselist • In most cases once macros are written with

macro editor, the execution is performed with caselist window

• List is executed either by pressing run button or from the batch queue

• Caselist OPTIONS may be used for example :• for collecting message monitorings • for collecting computer logs• for checking charging and statistic records

• Caselist options are list-specific

Page 101: HIT Training

101 . dia INFO NAP 2002 Roland Tóth from NOKIA

Caselist Syntax

• Each (expect caselist directive) line must begin with E or P letter

• E <CaseName> FileName::FunctionName(X)•E-case, or EXECUTE. List item is executed without caselist options

• P <CaseName> FileName::FunctionName(X)•P-case, or PERFORM. List item is performed with caselist options applied to item

• Caselist directives:• #options item item

•Caselist options for P-cases. Can be used to define messages monitorings, charging and statistics collection etc.

• #incpath path1; path2; …•Define include directory or directories

Page 102: HIT Training

102 . dia INFO NAP 2002 Roland Tóth from NOKIA

Caselist Options (1/2) • #options /T /C /P /R /M ="UNIT FAMILY" /H="UNIT

FAMILY"

• /R Directs the HIT system to check for hanging resources in the Marker and to ensure that the call ticket is complete. The flag calls macro CALLCHK.TEL in the HIT\INCLUDE directory

• /T Statistics (Tilastointi) flag causes the system to perform statistical macros for every P class test case. The macros are located in file STA.TEL in the HIT\INCLUDE directory

• /C Charging flag causes the system to perform charging macros for every P class test case. The macros are located in file CHARGE.TEL in the HIT\INCLUDE directory

Page 103: HIT Training

103 . dia INFO NAP 2002 Roland Tóth from NOKIA

Caselist Options (2/2)• #options /I /T /C /P /R /M="UNIT FAMILY" /H="UNIT FAMILY"

• /P change default calling order of pretest() and posttest() functions in relation to the message monitoring option /M and /H.

• Default calling order is: set_monitoring(), pretest(), main(), posttest(), get_monitoring().

• If /P flag is used, the calling order is: pretest(), set_monitoring(), main(), get_monitoring(), posttest().

• /M ="UNIT FAMILY" MSC Message monitoring flag causes the system to set message monitoring for the selected unit and family in the MSC. The default macros are located in file MONITOR.TEL in the HIT2/INCLUDE directory.

• /H="UNIT FAMILY" HLR Message monitoring flag causes the system to set message monitoring for the selected unit and family in the HLR. The default macros are located in file MONITOR.TEL in the HIT2/INCLUDE directory.

• More Options can be found from the HIT User's Guide

Page 104: HIT Training

104 . dia INFO NAP 2002 Roland Tóth from NOKIA

Example Caselist

Page 105: HIT Training

105 . dia INFO NAP 2002 Roland Tóth from NOKIA

Batchqueue

Batchqueue

List List ListMacro

MacroMacro

Macro

MacroMacro

MacroMacro

MacroMacro

Macro

Page 106: HIT Training

106 . dia INFO NAP 2002 Roland Tóth from NOKIA

Batchqueue• Non-interactive testing• Macros and lists are added to a batch queue

and executed; can also be added during batchqueue execution

• Generally used in overnight testing

Page 107: HIT Training

107 . dia INFO NAP 2002 Roland Tóth from NOKIA

Adding a File to the Batch Queue

Username is mandatory

Select the file to add to the batch queue

Batchqueue list is shown in a specific window

File types:

Macro files: *.tel, *.hit List files: *.lst

Page 108: HIT Training

108 . dia INFO NAP 2002 Roland Tóth from NOKIA

Summary

• Caselist provides a common interface to a collection of macros

• List window is for writing and running macrolists• Macrolist file is type .lst• Batchque enables the user to do non-interactive

macro execution• Caselists and macros can be added to a batchque

and executed• Batchques often used e.g. in night-time execution

Page 109: HIT Training

109 . dia INFO NAP 2002 Roland Tóth from NOKIA

Part 9:Options

Page 110: HIT Training

110 . dia INFO NAP 2002 Roland Tóth from NOKIA

Agenda

• Interpreter• Environment• Window Defaults• Load/Save Environment

Page 111: HIT Training

111 . dia INFO NAP 2002 Roland Tóth from NOKIA

Interpreter

Page 112: HIT Training

112 . dia INFO NAP 2002 Roland Tóth from NOKIA

Environment

Environment -dialog let the user configure the desk top as desired

- Macro window

- Editor

- Message window

- Response window

- Runtime

Page 113: HIT Training

113 . dia INFO NAP 2002 Roland Tóth from NOKIA

Window Defaults

• Window default -option is used for defining default font settings for the window types that can exist more than once

Page 114: HIT Training

114 . dia INFO NAP 2002 Roland Tóth from NOKIA

Load/Save Environment

• Environment settings can be saved for the further use and loaded with these options

• There can be several different configurations saved

Page 115: HIT Training

115 . dia INFO NAP 2002 Roland Tóth from NOKIA

Summary

• Environment -dialog allows the user to configure the desktop as desired

• Window default -option is for defining default font settings for windows

• Environment settings can be saved for the further use and loaded with the Load/Save environment options

Page 116: HIT Training

116 . dia INFO NAP 2002 Roland Tóth from NOKIA

Part 10:DLL & DDE

Page 117: HIT Training

117 . dia INFO NAP 2002 Roland Tóth from NOKIA

Agenda

• Definition of DLL's• Using DDE interface for Excel

manipulation

Page 118: HIT Training

118 . dia INFO NAP 2002 Roland Tóth from NOKIA

DLL = Dynamic Link Libraries

• The macro language allows the user to elaborate testmacros

• The built-in functions of the HIT macro language can also be extended with external functions from Windows DLLs

Page 119: HIT Training

119 . dia INFO NAP 2002 Roland Tóth from NOKIA

Dynamic Link Libraries (DLL)

External DLL-libraries can be used in HIT macros

dlldw Execute specified DLL function; returns a DWORD valuedllload Load the specified DLLdllfunction Execute the specified DLL functiondllfree Release the specified DLL from memorydllw Execute specified DLL function; returns a WORD value

Page 120: HIT Training

120 . dia INFO NAP 2002 Roland Tóth from NOKIA

DDE Interface

• The Excel application offers DDE services that can be used to read data from Excel sheets to the HIT application. HIT can also create Excel sheets and transfer data to the sheets using DDE.

Some useful DDE services

• Service Description• NEW create new sheet• ERROR(FALSE) turn off ‘workfile not saved’ warning dialog• CLOSE close active sheet

Page 121: HIT Training

121 . dia INFO NAP 2002 Roland Tóth from NOKIA

Usefull DDE functions

• CLOSE.ALL close all sheets• SELECT(“R1C1:R3C1”) select a range of cells• STYLE(1,1) boldface & italics style• NEW(2,2) add new chart from selection• GALLERY.3D.COLUMN change chart type to 3D-column• ARRANGE.ALL Tile windows horizontally

Microsoft Word

dokumentum

DDE related function list:

Page 122: HIT Training

122 . dia INFO NAP 2002 Roland Tóth from NOKIA

Connecting to the Excell

• It can happen it two steps!

• First step is connecting to the open excell• Read the sheet name which is curretly used• Close the connection

• Second step is connecting to the sheet opened by excell.

• Fill the cells• Close the connection

Page 123: HIT Training

123 . dia INFO NAP 2002 Roland Tóth from NOKIA

Quick programming guide

First step :

(Read the sheet name from excell)

ExcelDDE = ddeconnect("Excel","System");

topics = dderequest(ExcelDDE,"Topics");

strscan(topics,"%s",sheet);

ddedisconnect(ExcelDde);

Second step:

(connecting to the sheet)

ExcelDde = ddeconnect("Excel",sheet);

Page 124: HIT Training

124 . dia INFO NAP 2002 Roland Tóth from NOKIA

The End

Related documents

http://www2.connecting.nokia.com/net/global/netestooldistri.nsf/document/ES345M69L3?OpenDocument

Official HIT page

http://www2.connecting.nokia.com/net/global/netestooldistri.nsf/document/ES345M4DYC

Macrosystem page

http://wwwalltr.ntc.nokia.com/MSCHLR/msys/

HIT USAGE GUIDEfile://xesgrp001.nee.nokia.com/groups1/testtool/public/tools/hit/doc/hitguide.doc