0% found this document useful (0 votes)
1 views

How To Make a Terminal Script

The document provides a comprehensive guide on how to record a Terminal Script (RTE) using Load Runner, a performance and load testing software. It details the steps for initializing, recording, and configuring scripts, including parameterization and runtime settings. The importance of careful script preparation is emphasized, as it directly impacts the testing process conducted by virtual users.

Uploaded by

DK
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

How To Make a Terminal Script

The document provides a comprehensive guide on how to record a Terminal Script (RTE) using Load Runner, a performance and load testing software. It details the steps for initializing, recording, and configuring scripts, including parameterization and runtime settings. The importance of careful script preparation is emphasized, as it directly impacts the testing process conducted by virtual users.

Uploaded by

DK
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

Load Runner: How to Record

a
Terminal Script (RTE)

By:
Nikhil Mehta
DHL-APAC,
Infosys,
Pune.
Load Runner: How To Record a
Terminal Script (RTE)

1.0 INTRODUCTION

Load Runner, an application by Mercury is software which is used for performance and
load testing of applications. It supports a variety of applications. It helps to conduct load
as well as controlled testing of the application. It creates load by creating a number of
virtual users. These virtual users are much more consistent than normal users and hence
assist in a proper test. Also a Load Runner gives you an in-depth analysis of the system
on which the application is deployed. It has a variety of graphs which you give an in
depth report of the various parameters that you would like to monitor during the
test .Also after the test is done ,you can develop full fledged reports which contains all
the graphs and rest of the details of the test .

For any test that you have to run, you need to record a script. This script is nothing but a
recording of what you want every user to do. Once this script is recorded, the virtual
users work with this script. Hence it the most important part when testing is done using a
Load Runner.

The script is based on the application. You application may be a web application or a
terminal application or may be something else.

This document covers the various aspects of recording a Terminal Application script.

1
Load Runner: How To Record a
Terminal Script (RTE)

2
Load Runner: How To Record a
Terminal Script (RTE)

2.0 TABLE OF CONTENTS

1.0 INTRODUCTION.......................................................................................................2
2.0 TABLE OF CONTENTS............................................................................................3
3.0 RECORDING A SCRIPT...........................................................................................4
3.1 Initialization.............................................................................................................4
3.2 Recording Options...................................................................................................5
3.3 Recording the Script................................................................................................6
4.0 RUN TIME SETTINGS..............................................................................................9
5.0 PARAMETERIZATION..........................................................................................12
6.0 COMPILE AND RUN...............................................................................................13
7.0 MISCELLANEOUS..................................................................................................13
8.0 SUMMARY................................................................................................................14

3
Load Runner: How To Record a
Terminal Script (RTE)

3.0 RECORDING A SCRIPT

3.1 Initialization

1) Go to the directory where Load Runner is installed and open “Vuser Generator”.
2) When the “Vuser Generator” opens, go to “File” --> “New”.
3) When you click on new a new window opens which has various protocol options
like “Web/Html”,”Terminal Emulation” etc.
4) Choose “Terminal Emulation (RTE)”

5) On clicking a window will open which will have two frames.


6) On the left frame there will be three options namely “vuser_init”,”Action” and
“vuser_end”. On the right frame the respective code is present.

4
Load Runner: How To Record a
Terminal Script (RTE)

3.2 Recording Options

1) Click on “Tools” and choose “Recording Options”.

2) Select the options which will result in the synchronization of the “TE_wait”
function. For Automatic Synchronization (in IBM terminals) use the “X-system”
option.
3) Click Ok to accept the options.

5
Load Runner: How To Record a
Terminal Script (RTE)

3.3 Recording the Script

1) Click on “Vuser” from the menu and select “Start Recording” to start recording.

2) On clicking, a window will open. Also a small toolbar namely “Recording …”


will appear.

6
Load Runner: How To Record a
Terminal Script (RTE)

3) Now choose “Connection” from menu, and click on “connect” on the sub menu.
4) On clicking on “connect”, another window will open namely “Connect”.

5) Choose the session type (default is “TELNET”).


6) Now type the host id. For e.g. “ 206.236.141.57”
7) The port number is based on the “Session Type” you choose.
8) Choose the terminal type and id accordingly.
9) Once this is done, you can save the session.
10) After the setting are done click on the “connect” button.
11) On click “connect”, the session and recording starts.

7
Load Runner: How To Record a
Terminal Script (RTE)

12) On the window type the login and password (server login), select the proper
instance and enter the path of the directory where the application executable is
present.
13) Run the application.
14) Now logically divide your script into init, action and end. The “vuser_init” and
“vuser_end” parts of the script are always executed once and the “Action” can be
executed many times. Hence the “vuser_init” and “vuser_end” should contain
the start part which you don’t want to repeat like the login, log out etc. So for
example if you want a user to login , query for 20 -30 minutes (multiple queries)
and then log out after the set duration , then login will be in “vuser_init” ,the
querying part will be in “Action” and the log out will be in “vuser_end”.
15) Initially the recording will be done in “vuser_init”.If you want to change it to
“Action” or “vuser_end” at any point during recording the script, click the pause
button on the “Recording” toolbar. From the drop down on the toolbar select
“Action” or “vuser_end” and again click on record button.
16) When the recording is over, click the stop button on the “Recording” toolbar.
17) Now once the recording is done, you will see the generated code.

8
Load Runner: How To Record a
Terminal Script (RTE)

9
Load Runner: How To Record a
Terminal Script (RTE)

4.0 RUN TIME SETTINGS

1) Click on “Vuser” from the menu and choose “Run-Time Settings”.


2) On clicking a new window will open.
3) If you select “Run Logic”, you can specify the number of iteration you want the
script to be run.

4) If you select “Pacing”, you can specify the general pacing of the iterations in a
script.

10
Load Runner: How To Record a
Terminal Script (RTE)

5) If you select “Think Time”, you can specify whether the script should wait for the
think time specified in the script.

6) If you select “Logging”, you can enable or disable logging with the required
setting.

11
Load Runner: How To Record a
Terminal Script (RTE)

7) If you select “Miscellaneous”, you can set the Error Handling, Multithreading and
Automatic Transaction options using this.

8) If you select “RTE”, you can set the Maximum Connection Setting, Typing Delay
and X-System Synchronization.

9) After the settings are done, click on “OK”.

12
Load Runner: How To Record a
Terminal Script (RTE)

5.0 PARAMETERIZATION

If you want that in the script the query criteria should not be hard coded and script
should pick the query criteria from a file, then parameterization is required. Note that
the file should be a .csv file.
1) For parameterization click on “Vuser” on the menu and choose “Parameter
List”.
2) On clicking a new window opens namely “Parameter List”.

3) To add a new parameter, click on “New” and enter the name of the parameter.
4) Enter the path of the .csv file from which value has to be taken.
5) When you select the file, the file format gets set.
6) Now select the column either by number or name which will be represented by
this parameter.
7) Now select how the value should be picked up from the .csv file i.e. “Sequential”,
“Random” etc under “Select next row”.
8) After this choose the option under “Update Value On” which will specify when
do you want to get the value updated .For e.g. if you want that the value should be
taken from the .csv on each iteration of the script, choose “Each Iteration”

13
Load Runner: How To Record a
Terminal Script (RTE)

9) If you think the iterations are much more than the rows in the .csv file and choose
the option under “When out of values”.
10) After adding all the parameters, click on “Ok”.
11) Now in your script find out the place where the values were hard-coded and
submitted.
12) Replace the value with the parameter you want to specify .Note that the
parameter is always given under curly braces. Also the parameters are case sensitive.
For e.g. If the date is hard-coded as “01/05/01” in the script and you want that this
value should be taken from the .csv from the column “DateTo” and you have
specified a parameter for it as “dateTo”. Then replace “01/05/01” with
{dateTo}.Also Note that when you give the parameter with curly braces its colour
changes.
13) This is how the parameters are added.

6.0 COMPILE AND RUN

1) Now the script is to run.


2) Now you can compile the code by clicking the “Vuser” in the menu and then
choosing the “Compile” option.
3) You can run the script by clicking the “Vuser” in the menu and then choosing the
“Run” option.

7.0 MISCELLANEOUS

Now there are a few things one needs to take care of

1) When the script is run there are a lot of “TE_wait” functions that are added to the
script, these function basically looks for a particular text which is specified in the
function “TE_wait_text”, at the coordinates specified in the function
“TE_wait_cursor”. This is to make sure that the whole script was properly run
and all the steps of the script were properly executed. If this cannot find the text
specified at the coordinates specified, a failure is reported. But during recording
the script this function is specified at a lot of places where it is not required or at
some places the text which is specified is not correct. Hence before running take
care that the function is at the right place and the text is correct.

2) During the recording of the script, the time during which the application is static
i.e. you are waiting to enter the path or some other idle time, is also added in the
script as “lr_think_time”.Now remove this time from the places you don’t
require or if you don’t want to have any think time in the application choose
Ignore Think Time under Run Time Settings.

After following these steps your script is ready for use.

14
Load Runner: How To Record a
Terminal Script (RTE)

8.0 SUMMARY

The scripts are used in the scenario which is run in the Load Runner Controller.
This forms and important part of the testing procedure as each of the Vuser will
follow whatever is exactly recorded in the script. Hence utmost care should be taken
while preparing a script because it forms the base of the whole testing procedure.

15

You might also like