Beruflich Dokumente
Kultur Dokumente
raj.kamal13@gmail.com www.itest.co.nr
Courseware Information
This introductory course is designed to familiarize testing professionals with the basics of Rational Test Manager The focus will be on applying Rational Test Manager to define, configure and design test cases, define project iterations, configurations and computers and establish traceability links between test inputs and test cases.
Build a Test Plan Create Test Cases Configure test Cases Design test Cases Create Planning Reports
Modifying Scripts
Although Robot generates complete, executable scripts, sometimes you may want to edit a recorded script for example, to:
Script files
.s
.wch
.h
VU addition to C Language
The VU language contains a number of commands in addition to standard C programming language commands. Environment control commands Enable you to control a virtual testers environment by changing the VU environment variables. For example, the number of times to try a connection.
A list of one or more environment variables, separated by commas and optionally by white space. If env_var_list contains one item, the brackets are optional. If env_var_list contains more than one item, pop operates on the items from left-to-right. ENV_VARS. This specifies all the environment variables.
Library Routines
I/O Routines : open, close, fseek, feof, fgetc, fputc, fprintf, fscanf etc. Conversion Routines : atoi, ctos, stoc etc. String Routines: sindex, strlen, strstr, substr, subfield etc. Random Number Routines: negexp, rand, uniform etc.
Datapool commands
datapool_close datapool_fetch datapool_open datapool_rewind datapool_value Closes an open datapool. Moves the datapool cursor to the next record. Opens a datapool. Resets the cursor for the datapool. Retrieves the value of a specified column.
VU Toolkit function
Data commands: AppendData: Adds the data returned by sqlnrecv to the specified data set. FreeAllData: Frees all data sets saved with SaveData and AppendData. FreeData: Frees specified data sets saved with SaveData and AppendData. GetData:Retrieves a specific value created with SaveData or AppendData. SaveData: Stores the data returned by the most recent sqlnrecv command.
VU Toolkit function
File I/O commands: NextField :Parses the line read by the ReadLine function.
NextSubField: Parses the field returned by the most recent call to NextField or IndexedField.
ReadLine:Reads a line from the open file designated by file_descriptor. SHARED_READ: Allows multiple virtual testers to share a file. IndexedField :Parses the line read by the ReadLine function and returns the field designated by index.
Emulation commands
SQL Emulation commands & Functions SQL Send Emulation Commands
HTTP Send Emulation Commands http_request: Sends an HTTP request to a Web server.
Socket Receive Emulation Commands sock_nrecv: Receives n bytes from the server. sock_recv : Receives data until the specified delimiter string is found.
Socket Emulation Functions sock_connect, sock_create, sock_disconnect, sock_open etc
Note: VU supports the SAP protocol by using external C functions and the emulate command.
start_time: Enables you to define start and stop times. stop_time: Enables you to define start and stop times. testcase: Checks a response for specific results and reports and logs them
Program Structure
VU programming structure is similar to the structure of the C programming language. #include <VU.h> #include <VU_tux.h> proc proc_name() { /* body of procedure */ } func function_name() { /* body of function */ } /* main body of script follows: */ { string declarations; shared declarations; /* VU code goes here*/ }
Header Files
VU header files contain a collection of definitions and macros. VU.h is automatically included in scripts generated from recording HTTP, SQL, and socket sessions. VU_tux.h is automatically included in scripts generated from recording a TUXEDO session.
If you are manually writing a script, include the following preprocessor statement:
#include <VU.h>
If you are manually writing a script that accesses a TUXEDO application, include both VU_tux.h and VU.h as preprocessor statements:
#include <VU.h> #include <VU_tux.h>
The EOF value returned by various VU functions. The file descriptors for the standard files.
Preprocessor Features
Replace tokens : Token replacement and macro substitution can be specified with the #define preprocessor command. To indicate simple replacement throughout the entire script, use a command of the form: #define orig_ident new_token Include more than one source file in a script: The #include preprocessor command lets you include another source file in your script at compile time. This command has two forms: #include <filename> #include "filename" Compile parts of a script: Conditional compilation commands allow you to conditionally compile parts of a script. There are three ways to specify conditional compilation: #if-#else-#endif #ifdef-#else-#endif #ifndef-#else-#endif
Functions
Functions Subroutines that return a value through a return statement. You define functions with the func keyword. [type] func fname [array_spec] (arg_list) arg_declar; { stmnt1; stmnt2;
Procedures
Procedures Subroutines that do not return a value. You define procedures with the proc keyword. proc pname (arg_list) arg_declar; { stmnt1; stmnt2;
External C Variables
C Variable Type VU Variable Type
External C Variables
In a script an external C string is read-only unless its VU declaration includes its maximum size. The C code must allocate space for the string greater than or equal to maxsize bytes. The maximum size must include room for the C null-terminator character '\0'; it is specified with a colon and an integer constant, as in: external_C string:81 extc_line;
External C data cannot be declared persistent or shared. Values of external C variables persist for the duration of the run.
1. Write and compile the C source code to be called from your VU script.
2. Examine the VU script, and note which functions and variables the script needs to access. 3. Create the DLL, and export the necessary symbols.
Stress tests Verifies the acceptability of the server's performance behavior when abnormal or extreme conditions are encountered, such as diminished resources or an extremely high number of users.
Contention tests Verifies that the server can handle multiple user demands on the same resource (that is, data records or memory).
LoadTest
Load testing is designed to test client or server response times under varying loads.
Load tests also are used to compute the maximum number of transactions a server can handle over a given time period.
Questions