Share this page

# Compile and run a script as part of a package

When creating a Java Vuser script, you may need to use methods in other classes in which the class or method is protected. If you try to compile this type of script, you will receive errors in the compilation stage indicating that the methods are inaccessible.

To make sure that your script can access these methods, insert the package name containing these methods at the top of the script, just as you would do in a standard Java program— <package_name>.

Example:

This script defines the my.test package which consists of a path. Not that the package statement must be the first line in the script, similar to Java (excluding comments).

    package my.test;
    import lrapi.*;
    public class Actions
    {

    }

VuGen automatically creates the my/test folder hierarchy under the Vuser folder, and copies the Actions.java file to my/test/Actions.java, allowing it to compile with the relevant package.

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1-26.3 All View Local Help Center View Online Help Center Version: