Java vuser is a custom Java virtual user script, which can use the standard Java language.
Select Java vuser in all protocols
Usually write initialization in initCode, Write business processes in the action, and write release processes and other code in the end.
I.JavaApplicability of virtual users
It is not suitable for performance testing of recorded business function pointsSuch as HTTP file downloads and video playback.
Performance testing of application systems developed based on Java(For example, the coreAlgorithmOr business execution efficiency, business modules that cannot be recorded in Java applications)
Test points that cannot be recorded are often used: Web applications with controlsProgram, Which is related to media playback and file download.
II.Configure the Script Development Environment
First, install JDK and configure environment variables.
In computer properties-advanced system settings-advanced-environment variables, set path, classpath, java_home
Iii. Problems Encountered
Error: failed to find java.exe.
Please add the <JDK> \ bin to the path and try again. [msgid: MERR-22968]
Warning: Extension java_int.dll reports error-1 on call to function extperprocessinitialize [msgid: MWAR-10485]
Error: thread context: call to service of the driver failed, reason-thread context wasn't initialized on this thread. [msgid: MERR-10176]
Find out the cause: when detecting whether JDK is successfully installed, JDK can run normally, and LoadRunner installation has no problems. In this case, locate the problem of combining the two, first, you can identify the classpath in the environment variables in Java environment settings-> classpath in vuser-> Run-time setting, but the above error will still be reported.
When looking for the problem, I found that loadrunner11 did not provide any instructions. This version is a 64-bit software. If there is no instructions, it should be a 32-bit software by default.JDK should also be a 32-bit JDK.The 64-bit operating system is compatible with 32-bit software. I immediately installed the 32-bit JDK and restarted the server, delete all variables in Java Environment Settings> classpath in vuser-> Run-Time Setting and run the script again. The error disappears.