I shared how to use LoadRunner to build javauser performance test scripting environment, this time I tell you how to develop LoadRunner script in eclipse How to configure the environment, Poptest is the only training institute in the industry to develop test development engineers, To train students to do performance testing, automated testing, the ability to test tool development, to share a large number of performance test cases in Poptest class, due to limited personal experience, limited resources, can not allow the instructor's personal ability to keep up with the technical progress of the business, training institutions, lecturers are laurels, Poptest founder Li Eizhan, Wang Yuanbing and I all want to be able to teach students the first-line technology, so that students really learn the technology, and break the test training institutions of some vices, the lecturer's experience is weak, weak, training cases, such as a few problems, formed a strong curriculum of the development of the Expert Group, we formed a strong panel of experts, Continuous introduction of new cases, in the classroom to maintain a close integration of cutting-edge testing technology, we basically in each month's basic case will be a certain update. Let's look at how the LoadRunner script can be tested in eclipse.
When you create a new Java VUser with LoadRunner, the automatically generated action class references the "LRAPI.LR" package. The class file for this package is located under "LoadRunner root directory/classes/lrapi". Using these class files to generate the jar package, you can reference it in the Java project and write the LoadRunner script directly in Eclipse.
To generate the jar package process:
1, new project in Eclipse, named Lrapi.
2. Copy the Lrapi folder from the LoadRunner installation directory to the new project root in Eclipse, and refresh in eclipse to display the contents of the folder:
Export the jar package in 3,eclipse, and then click File-export-java (javafile). (select only the Lrapi folder when selecting Resources.) File name is Lrapi.jar), always next.
4, used in the introduction of the project:
package
defaultpk;
/*
* LoadRunner Java script. (Build: _build_number_)
*
* Script Description:
*
*/
import
lrapi.lr;
public
class
Actions
{
public
int
init()
throws
Throwable {
return
0
;
}
//end of init
public
int
action()
throws
Throwable {
lr.start_transaction(
null
);
System.out.println(
"This is a test for lrapi.jar"
);
lr.end_transaction(
null
,
0
);
return
0
;
}
//end of action
public
int
end()
throws
Throwable {
return
0
;
}
//end of end
}
The rest of the work is to develop the scripts we need, and we'll talk about how to develop LoadRunner performance test scripts in other development tools, and if you're interested in the course, add qq:564202718
Lao Li share: Eclipse in the developmental test LoadRunner script