Transferred from:
Http://hi.baidu.com/higkoo/blog/item/07b30d22357105b14623e892.html
This is really an afterthought. Today, I started to use eclipse to write the LoadRunner script.
In the past, most of them were written using the IDE provided by LoadRunner, and also used the visual stdio plug-in. To be more complex, use DLL or jar extension. Although debugging is troublesome, it is worthwhile to pack common functions and methods once and for all.
Recently, the project has been busy and we hope to develop test scripts quickly.
XML and JSON in the past are not complicated. It is good to use the LoadRunner built-in function and C function to process it together. The most painful one is to use LoadRunner to implement the Web/HTTP protocol + Windows Sockets protocol + MySQL + memcached script writing, and those who understand LoadRunner should be able to understand. Although the built-in C compiler can use C ++ extensions, the usage is not exactly the same and there are many traps. Java vuser is not as comfortable as Java development.
Today, I can't stand parsing the huge JSON string returned by the server with the char of the C statement! I can't bear it anymore.
Parse JSON strings is still the most convenient way to use Java. If you can use eclipse to compile the LoadRunner script, it's just like the vs plug-in of LoadRunner.
The method is simple:
1. Use eclipse to create a Java Project
2. Import the "% loadrunner_home % \ Classes \ lrapi" directory to the project.
3. Export the project as a jar package. For example, name it lrapi. jar.
4. When creating a Java project, introduce lrapi. jar to the extension library.
5. "Import lrapi. lr;" you can use the LoadRunner function.
6. "Import lrapi. Web;" can use LoadRunner's Web function.