Skip to main content

Creating Eggplant Functional Scripts in Eggplant Performance

Eggplant Performance lets you create Java scripts from your Eggplant Functional scripts so that you can use them in your workflows and tests like you would any other script in Eggplant Performance. See Working with Workflows and Managing Tests for more information about those tasks.

To create a Java script from an Eggplant Functional script in Eggplant Performance, perform the following steps:

  1. Add the Eggplant Functional suite you want to your workspace in Eggplant Performance Studio. See Managing Eggplant Functional Suites in Eggplant Performance) for more information.

  2. In the Workspace tree, right-click the Eggplant Functional suite and choose Create scripts. The Create Eggplant Functional Scripts dialog box opens.

    create eggPlant Functional scripts

  3. Provide the information you want to use with the scripts in the appropriate fields:

    • Eggplant Functional suite: The path to the Eggplant Functional suite you selected fills in automatically.

    • Virtual User type: Each script is created based on the VirtualUserScript subclass of the virtual user (VU) type you select here. We recommend creating a custom Eggplant Functional VU, and then selecting that VU here. For information about the VirtualUserScript class, see the Relationship between VirtualUser and VirtualUserScript Objects.

    • Select the Eggplant Functional scripts to create: Select the Eggplant Functional scripts for which you want to create Java scripts in Eggplant Performance. For each script you select here, a Java script with the same name will be created in Eggplant Performance.

    • Default Connection Options: (optional) Specify connection information for a default system under test (SUT). It is important to note that each VU must connect to a different SUT, and you need to set up a data binding to handle each connection. Eggplant Performance uses any keys defined in a data dictionary before it uses the connection information entered here. See Using Data Sources in Eggplant Performance and information on assigning data sources for information about setting up these data bindings.


      When you create a script from an Eggplant Functional script, it contains a Connect command and then sets the ConnectToSUT option to false to prevent extra connection attempts. The advantage to this is you can specify the Connect command in the first script in a workflow, for example, and then know that the other scripts in that workflow will not be attempting connections.

    • Connection Name: This drop-down menu shows the names of the SUT connections defined in your Eggplant Functional application. Choosing a SUT value using this drop-down menu populates all of the other connection option fields.

    • Server: The hostname or IP address of the SUT.

    • Port: The port of the SUT connection software. The default is 5900 for a VNC connection type. The default port for RDP connections is 3389.

    • Username: A user name for the SUT connection software, if one is required.

    • Password: The password for the SUT connection software, if one is required.


      Eggplant Functional stores encrypted passwords in the Connection List entries. Consider one of the following possible actions:

      • If you select an option from the Connection Name drop-down menu, the Password field is populated with the encrypted password. For encrypted passwords, the generated script uses the ConnectionProperties.setPasscode() method to supply the encrypted password to Eggplant Functional. Eggplant Functional then decrypts this password before connecting to the SUT.
      • If you enter the password in the Password field, or if you change it from the current value, the generated script uses the ConnectionProperties.setPassword() method to supply the plain password to Eggplant Functional. Eggplant Functional then uses this password to connect to the SUT.
    • Connection type: Choose VNC (the default) or RDP as the type of connection you want to make for the SUT.

  4. When you finish entering information, click OK. Eggplant Performance will create the new scripts in Java. You can now add them to your Eggplant Performance workflows and tests. See Working with Workflows and Managing Tests for more information.