Using Eclipse to lead the LoadRunner API into a jar package

Source: Internet
Author: User
Tags throwable

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:

Create a new project in 1,eclipse, name Lrapi.

The Lrapi folder in the 2,loadrunner installation directory is copied to the root of the project you built in the previous step and refreshed in eclipse:

3. Export the jar package from Eclipse and click File-export-java (javafile). When selecting resources, just tick the Lrapi folder. The file name is Lrapi.jar. All the way next.

4, used in the introduction of the project:

 PackageDEFAULTPK;/** LoadRunner Java script. (Build: _build_number_) * * Script Description: **/ ImportLRAPI.LR; Public classactions{ Public intInit ()throwsThrowable {return0; }//End of Init       Public intAction ()throwsthrowable {lr.start_transaction (NULL); System.out.println ("This was a test for Lrapi.jar"); Lr.end_transaction (NULL, 0); return0; }//End of Action       Public intEnd ()throwsThrowable {return0; }//End of End}

Using Eclipse to lead the LoadRunner API into a jar package

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.