Sie sind auf Seite 1von 124

NOKIA

HIT
Holistic Integration Tester)
2005-09-27

Presented by:
Roland Tóth NET/Budapest
NOKIA
Instructor:
Tóth Roland
Senior Software Verification Engineer
(NET R&D / Budapest)
NMMITHU8
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 Lunch
Time range: 13:00 – 15:00
• Part 11: Exercise / Practising
Part 1:
General Information
Agenda

• Background
• Main Features
• How to use HIT
• User Interface
• Toolbar
• Toolbar Dialog
• On-line Help
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
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/
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

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


Main Features

Use of DDE
-functions
Extensible with TEL-
DLLs language
Serial port and
Result TCP/IP connections
analysis HIT
Debugger Device
features control
System function Queueing
libraries mechanism
Automatic Case list
macro features
execution
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.
What Must Be Tested -1
• One Network Element must be tested without other
network elements
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)

HLR SCP PBX


Simulation Simulation Simulation

A-Interface PSTN
Simulation MSC Simulation
(MS+BSS)
User Interface

Macr Lis
o t

Respo
nse

Messa
ges
Toolbar

File actions Text actions Debugger actions

Find
New File Undo Syntax Check Send Next Run To Cursor

Find Next
Open Run
Cut Skip Step Over

Replace
Replace File Copy Stop Goto Trace Into

Save Paste Fast Mode Reset


Toolbar Dialog
Possibility to insert to the Main Window
Toolbar: Send Next
Skip
Goto
Run To Cursor
Step Over
Trace Into
Send Break
Print
Print Preview
Add Watch
View Watch
Call Stack
Terminal 1
Terminal 2
Terminal 9
User Help 1
User Help 2 Available only in HIT versions 2.2-0 or later.
User Help 9
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
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
Part 2:
Device
Part 2: Agenda

• Background on devices
• Device System Functions
• Device Configurations
• Com Connections
• Telnet Connections
• Prompts
• Login
• Resurrection
• Terminal
• Miscellaneous
• Configurations
• Connect
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
Device Configurations

List of defined User may


connections create, edit or
for the system delete Telnet
is shown here and COM
-connections
COM Connection
Telnet Connection
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
Login
Resurrection
Terminal
Miscellaneous
Configurations

If the
All the connection is
defined not currently
connections in use (used
for the by a macro
system will or have a
be shown window
here open), the
status is
closed
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

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


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
Toolbox
User can create tool-buttons for frequently used activities

Select the button and the


command type

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


Part 3:
HIT Language
Agenda

• Writing Macros
• HIT Macro Language (TEL)
• Variables
• Referring to Variable Values
• Arrays
• Control Statement
• If, While, For, Switch, Break and Abort
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
HIT Macro Language (TEL) /1

• Comments: /* */ , // , :
• Continuation: \
• Assignment: =
• Comparison: ==, <>, >, >=, <,
<=
• Math: +, ++, -, --, *, /
• Logical: AND, OR, NOT
• Bitwise: &, |, ~, ^, <<, >>
• Substring: ” ‘…’ ” in search
expression
HIT Macro Language (TEL) /2
• #include
• #define
• #incpath

• Hasoption() detection function for used own option


string detection
• E.g. > #option /test

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


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;
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");
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[ ][ ]
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]);
endfor
endfunction
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
Control Statements
IF

if( x < 100)


y = 2;
elseif( x > 100 AND x
< 200 )
y = 3;
else
y = 4;
endif
Control Statements
WHILE

while( Y < X )
print( "Number Y is: %d\n", Y );
Y++;
endwhile
Control Statements
DO

Integer x = 10;
Integer y = 1;
do
print( "Number Y is: %d\n",
Y );
Y++;
until ( Y < X )

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


Control Statements
SWITCH
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
Control Statements
BREAK

while ( i < 100 )


status = DoSomething();
if ( status == FALSE )
break;
endif
endwhile

If ( status == FALSE ), execution is continued after


endwhile despite the value of i.
Control Statements
ABORT
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
endfunction
If ( nbr == CANCEL ), macro execution is
terminated
Control Statements
RETURN
• 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.

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


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
Part 4:
Functions
Agenda

• Definitions of Functions
• HIT System Functions
• User Specified Functions
• Toolbox
Functions
F U N C T IO N S

U s e r 's S p e c if ie d H IT S y s te m
F u n c tio n s F u n c tio n s

P a ra m e te rs F u n c tio n
P a ra m e te rs
pass by r e tu r n in g a
p a s s b y v a lu e
re fe re n c e v a lu e
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:
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 functions used with
external
applications
• DLL functions dllload ()
• FTP functions e.g. used in
M9
• Directory Functions getworkdir
()
• Miscellaneous Functions
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
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
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
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);
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);
}

60 . 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);
}

61 . 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.

62 . 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’ ”);

63 . 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

64 . 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

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


Functions:
Passing Traditional Array as an Argument
function 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
66 . dia INFO NAP 2002 Roland Tóth from NOKIA
Functions:
Passing Associative Array as an
Argument
function 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

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


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
HIT object model
calls calls calls
STATEM
is ASSIGNM
BATCH LIST MACRO
ENT ENT using
has is
FLOW
is DATA
OPTIONS
CONTROL simple
array
const
monitoring if-else / for / FUNCTION is var
charging while
statistics is
is DIALOG
complogs is RESP
ANA
string / conv / file /
time
controlled by PORT
checking
SEND
SETTINGS ask
getline
menu
has strfetch
device using pause
strscan
question OUTPUT
send giving
answer tx
suffix goes to
PORT goes to
timeout
setdelay has
is DESKTOP
getdelay FILE WINDOW SETTINGS
COM

TCP / IP log response


internal
monitoring terminal
external

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


HIT SCHOOL

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


Hit Advanced Modules
• Errors
• Debugger Features
• Response Analysis
• Lists&Batchqueue
• Options
• DLL

71 . 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

• LibraryCollection of functions written in the HIT


language

• Batch A group of HIT macros and/or case lists


that are executed when batchqueue is started.

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


Part 5:
Errors

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


Agenda

• Error Types
• Error Handling
• Runtime Error Recovery

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


Errors
E rro rs

S y n ta x C h e c k R u n tim e L o g ic a l E r r o r s

In v a lid fu n c tio n
In v a lid S y s te m
p a ra m e te r E x p r e s s io n s
a s s ig n m e n t fu n c tio n s
ty p e s

M is s in g
s e m ic o lo n
In v a lid
In v a lid U n in itia liz e d
p a ra m e te r D e v ic e T a b le
s tr in g v a r ia b le s
v a lu e s

" D e v ic e n o t " D e v ic e n o t U n in itia liz e d


In d e x
fo u n d " s e le c te d " a rra y

75 . 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
76 . dia INFO NAP 2002
executing of the list/batchque!!!
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

77 . 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

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


Part 6:
Debugger

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


Agenda

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

80 . 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

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


Run

Execution mode

Syntax check for a


macro
Start macro or caselist
execution

User event
calling

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


Debugger

Breakpoi
nts
Active
variables
Watch

Call
Stack
83 . 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-menu
Background 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
84 . 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

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


Other Debugger Features
Provide on-line information:

• Watch properties
• - Variables can be hand-
picked into a watch
window

• Call stack
• - Window showing the
function calls and their
arguments

86 . 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

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


Part 7:
Response Analysis

88 . 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

89 . 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

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


File Functions & Log Handling
Functions
File Handling Log handling
Functions functions

• Opens a file to be used • Opens a file to be used


by a macro file by the macro

• Returns a handle to this • Hides the handle from


file the user

• Referring to the file • Automatically refers to


the user needs to the file the user
specify the handle doesn't need to specify
the handle

91 . 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

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


File System Functions
Function Description
fileaccess Determine existence of the specified file or directory
fileclose Close a file.
filecopy Copies specified file
filedelete Delete a file
filegetline Search and read from a file.
filegetpos Return current file pointer position
fileopen Open a file.
fileprint Formatted output to a file.
fileread Read from a file.
filereceive Receive files from connected device using Kermit protocol
fileseek Position the access point in a file to top or bottom or current
filesetpos Sets file pointer position
filesize Get file size
filetransmit Send the specified file to the remote device using Kermit protocol

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


Log Handling Functions

unction Description
etline Read or seek line from the log stream.
etlogname Get the name of the current log file.
ogclose Close log file.
ogcloseaux Close an auxiliary log file
ogenable Toggles logfile writing
ogfilter Turns (escape character) filtering ON/OFF
ogprint Write to log file and to message window.
ogscreen Writes last n lines from screen buffer to the current log file
ogseek Position the internal log pointer to top or bottom of log or to last.
ogset Open log file.
ogsetaux Open auxiliary log file
ogsize Gets the specified log size.
ogwaitline Same getline() except it doesn't return until complete line is read

94 . 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);

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


Log open and positioning
example:
unction 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.

96 . 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

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


Part 8
Caselists & Batchqueue

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


Agenda

• Macrolist
• Definition of a Batchque

99 . 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

100 . 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
•Caselistoptions for P-cases. Can be used to define messages
monitorings, charging and statistics collection etc.
• #incpath path1; path2; …
•Define include directory or directories

101 . 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

102 . 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

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


Example Caselist

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


Batchqueue

B a tc h q u e u e

L is t L is t L is t
M a c ro

M a c ro M a c ro M a c ro
M a c ro M a c ro M a c ro
M a c ro M a c ro M a c ro
M a c ro

105 . 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

106 . 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
File types:
Macro files: *.tel,
*.hit List files:
*.lst

Batchqueue list is
shown in a specific
window
107 . 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

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


Part 9:
Options

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


Agenda

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

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


Interpreter

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


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

-
Editor
- Message
window

- Response
window

-
Runtime

112 . 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

113 . 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

114 . 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

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


Part 10:
DLL & DDE

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


Agenda

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

117 . 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

118 . 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 value
dllload Load the specified DLL
dllfunction Execute the specified DLL function
dllfree Release the specified DLL from memory
dllw Execute specified DLL function; returns a WORD
value

119 . 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

120 . 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

DDE related function


list:

121 . 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

122 . 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);

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


The End

Related documents
http://www2.connecting.nokia.com/net/global/netestoo
ldistri.nsf/document/ES345M69L3?OpenDocument
Official HIT page
http://www2.connecting.nokia.com/net/global/netestool
distri.nsf/document/ES345M4DYC
Macrosystem page
http://wwwalltr.ntc.nokia.com/MSCHLR/msys/
HIT USAGE GUIDE
file://xesgrp001.nee.nokia.com/groups1/testtool/public/tools/hit/doc
/hitguide.doc

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