Tuesday, June 9, 2009

Code for puttting custome Pacing in script

Action()
{
merc_timer_handle_t timer;
double duration;
double pacing_time;

// Read desired pacing timer from a text file.
pacing_time = (double)jds_read_pacing_time("C:\\TEMP\\vugen_pacing.txt");

// Start the timer.
timer = lr_start_timer();

//Your Action Code

// Stop the timer
duration = lr_end_timer(timer);

// Wait for the necessary number of seconds to elapse
if (duration < pacing_time) {
lr_think_time(pacing_time - duration);
} else {
lr_error_message("Pacing time exceeded. Target: %G seconds. Actual: %g seconds", pacing_time, duration);
}

return 0;
}








// Read pacing time from a file. Returns time in seconds (whole seconds only).
// Note that file can be on a shared network drive.
int jds_read_pacing_time(char* file_name) {
long fs; // file stream
int number_from_file;

// Open the file for reading
fs = fopen(file_name, "r+");
if (fs == NULL) {
lr_error_message("Error opening file: %s", file_name);
return -1;
}

// Read number from file.
if (fscanf(fs, "%d", &number_from_file) != 1) {
lr_error_message("Error reading number from file: %s", file_name);
return -1;
}

fclose(fs);

return number_from_file;
}

URL vs HTML recording mode

HTML based mode, records script for every user action that is
performed during recording, while URL based mode records each and
every browser request to the server and resources received from the
server.

IN HTML recording mode the execution will be fast..as all
the server responses will not be captured in the script.
In URL all the server responses will be captured in the
script and hence the execution will be slow

how to monitor tomcat 6.0.16 with jconsole

go to tomcat bin folder
click on tomcat6w.exe
go to java tab
go to java options
type :
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8090
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
you are all set to go
now you can monitor your tomcat through jconsole and give port as 8090

back or referesh error with siebel protocol in loadrunner

hi this is a very common problem everyone facing while working on
siebel protocol of loadrunner.
this problem is coming from 2nd iteration .

solution is very simple

run the script and see in which web_url or web_submit, this problem is
coming soo just change mode to http from html and resources from 0
to 1.

I hope this will surely help you

How to convert Web based http Script to Java Vuser Script

Hi All,

loadrunner has two file

1: sed.exe (in loadrunner bin directory)
2: web_to_java.sed (in loadrunner dat directory)

with the help of above files we can convert a WEB(http/html) script
to java script

STEPS:

1:Record your script using WEB(HTML/HTTP) protocol.
2:Add Loadrunner Bin directory to your PATH enviroment variable.
3:Copy a part of your script to a text file (for example script.txt).
4:Go to loadrunner DAT directory.
5: run the following command

sed -f web_to_java.sed "path of your script txt file" > "Destination
java file path"

ex:
sed -f web_to_java.sed script.txt >java.txt

Points to remember

1: Java scrpit use "<>" parameter braces and httpl/html uses "{ }".
Above command will not replace this. so manually we need to change
this. Above command will put following warning before each line that
uses parametrization

"Suspected parameterization in next line. If true make sure to
substitute {} with proper parameter braces on the parameter".