How to Create VAPI-XP Test Scripts

You create a VAPI-XP test script from the test plan tree in the Test Plan module.

To learn more about VAPI-XP tests, see VAPI-XP Tests Overview.

Note: You can also convert a manual test to a VAPI-XP test. In the Design Steps tab, click the Generate Script button and select VAPI-XP-TEST. ALM creates a VAPI-XP test script that includes code for the steps that you defined. It also includes code for called tests that were part of the original manual test. For details on manual tests, see Test Design.

To create a VAPI-XP test script:

  1. Choose a subject folder in the test plan tree.

  2. Click the New Test button or choose Tests > New Test. The New Test dialog box opens.

  3. In the Test Type box, select VAPI-XP-TEST.

  4. In the Test Name box, type a name for the test. Note that a test name cannot include the following characters: \ / : " ? < > | * % `

  5. Add test details in the Details tab. Click OK.

    Note: If required test fields were defined in the Project Customization window, the Required Test Fields dialog box opens. Select values for the required fields, and click OK.

    The Micro Focus VAPI-XP Wizard opens.

  6. In the Script Language box, select a script language.


    • To create a VAPI-XP test script using ActiveState's ActivePython or ActivePerl scripts, you must install the script language on your machine. From the Help menu in the Test Script tab, select ActivePython Home Page or ActivePerl Home Page, and follow the appropriate installation instructions.

    • Microsoft's VBScript and JScript are usually installed with Internet Explorer. If they are not installed on your machine, select VBScript Home Page or JScript Home Page from the Help menu in the Test Script tab, and follow the appropriate installation instructions.

  7. In the Script Name box, type a name for the VAPI-XP test script.

  8. If you selected VBScript or JavaScript as your test scripting language, you can select Create LoadRunner Vuser to create a LoadRunner virtual user script that can be run in the LoadRunner Controller.

    Note: To run this virtual user in the Controller, you must install the latest version of the ALM Connectivity Add-in on your LoadRunner client machine. This add-in is available from the Application Lifecycle Management Tools add-ins page. For details, refer to the Micro Focus Application Lifecycle Management Installation and Upgrade Guide.

  9. Click Next to continue creating the test script using the Micro Focus VAPI-XP Wizard.

  10. Note: In each dialog box, you can click Finish to close the Wizard and continue creating the test script in the Test Script tab.

  11. Select the type of test you want to create.

  12. Click Next to continue creating the test script using the Micro Focus VAPI-XP Wizard.

    • If you selected COM/DCOM Server Test, choose the Program IDs of the COM/DCOM objects in your machine's registry that you want to test, and click the + button. Each selected COM/DCOM object and its description is displayed in the box.

    • If you selected Java Class Test, type the full name of the Java class that you want to test in the Java Class Name box, and click the + button. The Java class name you typed appears in the text box.

    • Note: You can only use a Java class that has a public constructor that does not take arguments.

      Under Java Virtual Machine, specify the following:

      • JVM Runtime. The Java virtual machine runtime executable file (usually java.exe).

      • Java Compiler. The executable file that recompiles the bytecode at the execution platform (usually javac.exe).

      • Classpath. A list of additional (non-standard) Java libraries, separated by semi-colons (;), required to run the specified Java application. Note that if you do not specify the Java classpath, ALM uses the environment variable CLASSPATH.

      • JVM Parameters. The parameters for the Java virtual machine run-time executable file.

      When working with Java virtual machines, add the location of the BSF DLLs to the system path, as follows: In the Control Panel, choose System > System Properties, and then click the Advanced tab. Click the Environment Variables button, and in the System Variables area, edit the Path parameter by adding the path of the following DLLs: msvcp60.dll, bsfactivescriptengine.dll, and bsfactivescriptengine_g.dll. Click OK.

    • If you selected Web Service (SOAP) Test, choose the SOAP client library from the SOAP Client Library list, and type or select the URL you want to test in the Web Service Definition box. Click the + button. The URL you typed appears in the text box.

    • Note: Two SOAP client libraries are supported: Microsoft SOAP SDK and PocketSOAP. Note that even if you choose to work with PocketSOAP, you must install Microsoft SOAP SDK to parse Web services. If Microsoft SOAP SDK is not already installed on your machine, run the SoapToolkit30.exe file located in the Redist directory on your ALM installation DVD.

    • If you selected Console Application Test, type the name of the application file you want to test in the Application Executable File box, and its parameters in the Command Line Parameters box.

    • Clear the Use VAPI-XP Output instead of Standard Output box if you do not want to replace the standard output with the VAPI-XP output window.

      In the Application Timeout box, type the time, in milliseconds, for ALM to wait for the application to finish running. Note that if the timeout is set to -1, ALM waits an infinite amount of time for the application to finish running.

      Click the + button. The data you entered appears in the text box.

  13. Click Next to continue creating the test script using the Micro Focus VAPI-XP Wizard.

  14. In the Service list, select the functions you want to add to your test script. Double-click each function, or drag and drop it, to add it to your script code. The function is added to the box below the Service list.

  15. If required, enter additional parameters or add extra code to the script in the lower pane.

  16. Click Finish. The new test appears in the test plan tree under the subject folder you selected.

  17. Note: You can choose to add details and attachments to the VAPI-XP test you created, or define requirements coverage. For information, see Test Plan Specification.