Sunday, January 1, 2017

How to Convert a Web - HTTP/HTML Vuser Script into a Java Vuser Script in Load Runner?

VuGen had an advantage  that enables you to convert a Web - HTTP/HTML Vuser script into a Java Vuser script. This also allows you to create a hybrid Vuser script for both Web and Java.

Steps for the Conversion:
  1. Create an empty Java Vuser script and save it with your desired name.
  2. Create an empty Web (HTML/HTTP) Vuser script and save it with your desired name.
  3. Record a session into the Web (HTML/HTTP) Vuser script.
  4. Replay the Web (HTML/HTTP) Vuser script. When it replays successfully, cut and paste the entire script into a text editor and save it as a text file (.txt). 
  5. In the text file, modify any parameter braces from the Web type, "{ }" to the Java type, "< >".
  6. Open a DOS command window and go to the / dat folder.
Type the below command
\bin\sed -f web_to_java.sed filename > outputfilename

filename- Full path and filename of the text file you saved earlier
outputfilename -The full path and filename of the output file.

Open the output file, and copy its contents into your Java Vuser script action section at the desired location.If you are pasting the contents into an empty custom Java template (Java Vuser type), modify the line containing public int action() as follows:
public int action() throws Throwable
This change is done automatically for recorded Java users (RMI and CORBA).

Parameterize and correlate the Vuser script as you would with an ordinary Java script, and run the script.

5 comments:

Unknown said...

I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon.

web designing training in chennai
java training in chennai

Unknown said...

Valuable information thanks for sharing Loadrunner Online Training

Akshaysri said...

Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
New Zealand Education Consultants in Chennai


abra said...

Well... whene should I get the "web_to_java.sed" file?
What does it contain?

manisha said...
This comment has been removed by a blog administrator.