Vous êtes sur la page 1sur 12

running the script

______________________________________________________________________________________

running the script :

you can run the script by pressing f5 of selecting vuser > run in the vugen window.

there is a option to run the script step by step.


see page 125 of creating vuser scripts.

after running the script see the folder with the script name in temp folder. you can see an output.txt file. this
gives various actions performed during the run.

see the following statements in the vuser scripts.


1. te_wait_text("retriev", 90);
this asks vugen to wait for the string “retriev” to appear on the screen. if the string doesnot appear in
the screen within 90 seconds timeout occurs.
we suggest you replace this by “ispf primary option menu”, since the former string may not appear for
all user id’s.
also replace
te_wait_text("f11=right f12=retrieve", 90);
by
te_wait_text("display ", 90);

2. te_wait_sync();
this asks vugen to wait for “x-system” to disappear before issuing the next command.

1
running the script
______________________________________________________________________________________

now we parameterize some of the arguments of the functions.


since we will be running the same script for more than 1 vuser with different user_id’s, we would like to
parameterize the user_id and password and store them in a data file.
this can done by taking the cursor to the desired string and right clicking the mouse. a small widow opens
on the screen as follows.

click replace with a parameter.


the following screen appears.

2
running the script
______________________________________________________________________________________

give a name for the parameter and click properties.


the following window appears.

3
running the script
______________________________________________________________________________________

since we haven’t created an input file. click create. click ok.


the following window appears.

4
running the script
______________________________________________________________________________________

replace “sequential” in the select next row by unique.


clear the advance row each iteration check box.
click close.
click ok.

the parameter appears in the vugen script. if you want to restore the original value instead of the parameter,
move the cursor on to the parameter , right click and select the restore original value option.

now we want to parameterize the password also.


take the cursor on the password string. right click the mouse.
enter a value for the parameter. click properties.
since we would like to give user_id’s and passwords in the same file, we give the same file name in the
“file path” box. the following screen appears.

5
running the script
______________________________________________________________________________________

click the add col button.


click ok in the resultant window.
replace “sequential” in the select next row box by “same line as user” (expand the down arrow to get this).

since we would like to run the same script for multiple users, we would like to have more rows in our data
file. to do this, click the edit button. the following window appears.

6
running the script
______________________________________________________________________________________

give more userid’s and passwords below the “bosnps,prasad2” row.


save the file and exit.
click close in the parameter properties window.
click ok in the next window to replace password by parameter in the script.

refer creating vuser scripts , page no 63 (updating parameter values from files) for more details on the
usage of sequential, unique etc.

now we set more iterations for the same script.


select vuser > run-time settings in the vugen window.
the following window appears.

7
running the script
______________________________________________________________________________________

select the iterations tab (it’s already selected in the above screen). increase the iteration count to your
choice in the “iteration count” box. note that only the action part is iterated. we can also modify the
iteration pace. the default is to start the next iteration as soon as the present iteration finishes. we can also
set the iteration to start after fixed time intervals. however if we give the time interval to be 10 seconds and
the iteration 1 takes 12 seconds, iteration 2 starts only after 12 seconds.
we suggest that iterations to be started at random intervals. this will emulate the real user behaviour.

now go to the log tab. disable logging to avoid unnecessary resource wastage.
now go to the think time tab. the default is to ignore think time. see the vuser script you recorded. you can
note the “lr_think_time(2);” functions. all these functions are disabled. however to emulate a real user
behaviour, you can change the settings.

now go to the action1 section of the vuser script.


look for the following statement.
te_type("pre aa**<kenter>");
we want different strings to be taken for different iterations.
for example, iteration 1 : pre aa**
iteration 2 : pre bb** etc.
so take the cursor to string “aa”, right click the mouse. enter the parameter name. click properties. the
parameter properties window opens. we create a new file by clicking the create button. we replace
“sequential” in select next row box by “unique”. see the screen below.

8
running the script
______________________________________________________________________________________

we edit the file. we enter the values as shown in the next screen.

9
running the script
______________________________________________________________________________________

suppose we have two vusers performing two iterations each.


the first vuser takes values aa and bb for iteration 1 and iteration2 respectively.
the second vuser takes values cc and dd for iteration 1 and iteration2 respectively.
we save the file, exit. click close. click ok.

you can run the script using vugen again for demo. note that using vugen we can run the script for only one
vuser. but you can see that two iterations are performed at random intervals.

to add transactions :
you can add transactions in the action section only.
take the cursor to the location you want to start your transaction. now right click the mouse.
the following screen appears.

10
running the script
______________________________________________________________________________________

select insert > start transaction as shown in the above screen.


start transaction window appears. enter the transaction name and click ok.
the following function appears with transaction name as the argument.
lr_start_transaction("tran1");
now move the cursor to the place you want to end the above transaction.
right click the mouse. the above screen appears.
select insert > end transaction.
end transaction window appears. select the transaction name from the list of options provided and click
ok. see the screen given below.

11
running the script
______________________________________________________________________________________

it is required to provide transactions to analyze the data generated. we will come to it later.

*** end of the document ***

12

Vous aimerez peut-être aussi