This Group is dedicated to Loadrunner Professionals who ask and answer day to day questions and problem that they encounter in their day to day professional settings.
Loadrunner Discussion
Subscribe to Comments RSS Feed in this post
4 Responses
Leave a Reply
You must be logged in to post a comment.
October 15, 2010 at 12:58 pm
Hi there all,
Can someone help me to display the date format of “08-09-2010
15:39:54″ into “40429.6535069444″.
I need to add this new format into a tuxedo buffer as a request.
Thanx
SP
October 26, 2010 at 4:06 pm
HERE IS A CODE TO LOG TO FILE: MAKE YOUR LIFE SIMPLE
//Log data to a file. Pass in the file name and the string to log
LogDataToFile(char *fileName, char *message)
{
int ilog;
long file_stream;
char filename[12000];
sprintf(filename,”%s\\%s-%s.txt”,lr_get_attrib_string(“LogPath”),fileName,lr_eval_string(“{dateforlogfile}”));
for (ilog=1; ilog<=10; ilog++)
{
if ((file_stream = fopen(filename, "a")) == NULL)
{
if (ilog == 10)
{
lr_error_message ("Cannot open %s", filename);
return -1;
}
}
else
{
fprintf(file_stream, "%s\n", message);
fclose(file_stream);
break;
}
}
return 0;
}
February 9, 2011 at 5:38 pm
Working with Java – Introduction – Loadrunner working with Java pretty cool
http://loadrunnertnt.blogspot.com/2007/05/working-with-java-introduction.html
February 9, 2011 at 5:38 pm
1]
Before we start choosing Java-related protocols to perform recording, you will need to understand the protocol that the Java application is using to communicate with the server. It maybe the case where the Java application is communicating via HTTP rather than RMI-Java, etc… Refer to the concept in a previously written article, “Protocols: What Protocol to use?”. Take note that it is the fundamental of using LoadRunner correctly.
If you have identified that the application is communicating with a Java related protocol, you can safely proceed to choose the relevant Java protocol.
[2]
For Java related protocol, the recording works in the same way as .NET and COM/DCOM protocol. All of them share the same characteristics but I will specify to just Java and only Java recording. Pure Java scripting will be excluded in this article.
Unlike .NET and COM/DCOM, Vugen provides an interface to manage and filter the classes and methods via the GUI which is very convenient to the user. Hopefully, Mercury/HP may consider that in future.
[3]
Java recording is not as straight-forward as popular (simple) protocols such as Web (HTTP/HTML) and the following lists out the items to take note when working with Java.
Classes and Methods
1. You will need the knowledge of the classes and methods prior recording; and usually this information is held by the developers.
2. The need to know the classes and recording is crucial because, LoadRunner (Vugen) implements a hooking mechanism to hook the traffic on the classes. Not knowing or minimal knowledge will definitely delay the recording.
3. LoadRunner does have a default hook for Java but if you have additional classes that you need to record. The knowledge of the classes will come important here.
4. Also, by defining all classes to hook, is a wasteful effort as you maybe recording classes’ activity that is not useful to the load test. They may comprise of GUI clicks or client activities.
JDK and JRE
1. You will need to know the JDK of the application. By default, Sun Microsystems JDK (SDK) works with LoadRunner.
2. You can check with Mercury/HP on the support for other JDKs (IBM, etc.). However, usually they are not supported.
3. The least supported JDK is JDK 1.3 for LoadRunner 8.1. Take note that the recording is still very dependant on the JDK version installed. That is, if your application is JDK 1.6, you will have to install that version on the recording machine.
4. JRE is insufficient for the recording to be successful. JDK is required to be installed.
Recording-specified
1. Vugen implements an API that hooks into the selected classes and record the traffic. Therefore, as pointed earlier, knowing the correct classes to hook is crucial.
2. GUI classes or client-side activities maybe recorded via the hook. However, this is not recommended as it does not contribute to the load generation towards the server.
3. For recording specifies, I’ve written another article that specifies the steps and the implications of each step in this article, “Working with RMI-Java” .
Scenario Execution
1. Prior the scenario execution in the Controller, ensure that JDK have be installed on the Load Generators. The scripts sent (refer to the article, “General: Scenario Execution” for more information) are Java scripts, and require JVM to run.
[4]
Documentations
If you like to know more information from the official provider, you can refer to the Vugen User Guide that is provided in each installation of LoadRunner in PDF format. Specifically the following chapters:
1. All chapters in Part II: Working with Java Language Protocols
2. Chapter 18: Developing Corba-Java Vuser Script
3. Chapter 19: Developing RMI-Java Vuser Scripts.
Sample
Also, if you like to get a feel of working with Java protocol, I would recommend using the sample example provided with every installation of LoadRunner. It will at least get you understand what will happened and the expected output when recording Java language applications.
[5]
In summary, we’ve covered the workings of Java language protocol in LoadRunner, things to watch out and additional resources to pertaining to the topic. It should be sufficient for you to work with Java language protocols at minimal difficulty.