Creating an Eggplant Performance Test Manually

Typically, you create an Eggplant Performance test by using the Objectives feature in Eggplant Performance Studio. However, as you get more familiar with all the elements that make up a performance test, and as you develop more test assets across your workspace and projects, you might choose to create your tests from scratch instead.

This section takes you through the step-by-step process of manually creating a test in Eggplant Performance Studio. The test creation method provided below is one of the several ways you can create a test in Eggplant Performance. The following sample test focuses on the functionality of Eggplant Performance Studio, and how you can use it to manage virtual users (VUs) and tests.

The following tasks related to creating a test are discussed below:

Creating a Workspace

Before you create an Eggplant Performance test, you must either open an existing workspace or add a new one in Eggplant Performance Studio.

The workspace contains all environment-specific data such as injector details, default editors, compiler locations, and custom VU types. A workspace allows you to switch between different environments easily. For example, you can switch between a test and a live environment, both of which can have different injector configurations.

To create a new workspace:

  1. In Eggplant Performance Studio, select File > New > Workspace.
  2. When the Add Workspace dialog box opens, enter a name for your new workspace in the Name field.
    The Add Workspace dialog box
  3. Enter the Location path where you want to save your new workspace.
  4. Click OK. A message displays to tell you whether or not your new workspace was created successfully. If it succeeded, the message prompts you to switch to the new workspace.
  5. Click Yes. Your new workspace opens in Eggplant Performance Studio.

Creating a Virtual User

Before you can generate scripts for use in your test, you need a virtual user (VU). You must create a new VU type before you can create your first script, but it is not always necessary to create a new VU before creating a new script.

Prerequisite:

You must add a new web VU type, which supports the record and replay of user interactions with web-based applications and servers using HTTP and HTTPS protocols. You can create a Web Java or C# Web VU, depending on your preference.

To create a new VU:

  1. If the Workspace tree is not already displayed, open Eggplant Performance Studio and display the Workspace tree.
  2. In the Workspace tree, right-click Virtual Users and select New Virtual User from the drop-down menu. The Create a Virtual User Type dialog box opens.
  3. Select virtual user type in [General.EpP%] [General.Studio%]

  4. Select Web Java Virtual User or Web C# Virtual User (your preference) from the list and click Next.
    Note: These examples use the Web C# VU. The name panel automatically opens with the Extends and Namespace fields populated. If you're creating a Java Web VU, you see a Package field instead of a Namespace field.
  5. Provide a Name for the new VU. The Class name field populates automatically as you type.

    Create a Virtual User Type dialog box

  6. Click Finish. Your new VU will be created and available in the main window.

Creating a Project

Eggplant Performance is a project-based, load testing tool. Scripts, workflows, data, and tests are all stored in a project. You must either open an existing project, or create a new one.

To create a new project:

  1. Select File > New > Project or click the New Project button on the toolbar. The New Project dialog box opens.
    New Project dialog box in [General.EpP%] [General.Studio%]
  2. Enter a name for your new project in the Project Name field.
  3. Click OK. Your new project will be created and open in the main window.
Note: To save a project, select File > Save or click Save on the toolbar.

Creating a New Script

You can create virtual user (VU) scripts by using any of these methods: use a script recorder, use a standard template, or import an existing source file. These instructions create a VU script from a recording.

To record a new script from a recording:
  1. With your project open, right-click Recordings in the Project tree, and select New Recording or click the New Recording button on the toolbar.
  2. Choose a Recorder panel in the Create a New Recording Wizard

  3. Provide a name for your recording, select Web Proxy Recorder from the drop-down menu, then click Next.
  4. Choose a web client application to launch panel in the Creating a New Recording wizard

  5. Choose the web browser from the Applications drop-down list that you would like to record your script against, then click Next. The About to start recording panel opens.

    About to start recording panel in the Create a New Recording wizard

  6. Click Start recording. The browser opens to a blank page and the recorder user interface (Eggplant Performance Proxy Recorder) opens. You will be prompted to install a certificate to record the HTTP traffic. Install the certificate if necessary. The wizard remains open in the background displaying the Recording in progress panel.
  7. In the web browser, perform the actions you want to record. These will be included in your first transaction. The default name of the first transaction, which is Start, was set on the Choose a web client application to launch panel (see step 2).
  8. In the Set Transaction field at the top of the Proxy Recorder, enter the name you want for the second transaction you would like to record, then click Set Transaction.

    Proxy Recorder toolbar

  9. Perform the actions in the web browser that should be included in the second transaction.
  10. Repeat the two previous steps until you are satisfied with the content of your recording.
  11. Click Next.
    Note: You can cancel your recording at any time and start the wizard again to create a new recording. Following is an example of the transactions you might want in your recording:
    • Second transaction name: goToWebsite, click Set Transaction, and enter the URL for the Google home page in the browser that appears. (Internet Explorer opened by default with the proxy recorder.)
    • Third transaction name: performSearch, click Set Transaction, and enter the Eggplant website in the Google search window.
    • Fourth transaction name: we entered selectResult, clicked Set Transaction, and then selected one of the results for the Eggplant website.
  12. Click More to view your recorded transactions. Alternatively, click the Requests tab to see the requests associated with your activity. The following page shows the selectResult transaction and the URL for Google. Note that the red dot button indicates that the recording was paused.
  13. The Request tab in the recorder showing the requests captured for the "selectResult" transaction

  14. When you've completed your recording, click proxy-recorder_stop-button on the recorder toolbar, or click close on the recorder to stop recording. You may see a prompt to confirm that you want to exit the recorder. When you exit the recorder, the Recording finished panel opens in the wizard.
  15. Click OK to confirm you would like to end the recording.
  16. Click Next to continue. The Filter hosts panel opens showing you the hosts that were found in your recording.
  17. Use the Filter hosts panel to specify which hosts you would like to have included in your final script. In the example below, the Allowlist filter mode is selected to specify that you only want to include the specified hosts.
    Filter hosts panel in the Create a New Recording wizard
  18. When you've specified host filters, click Next. The Recording complete panel opens, providing you the option to view the recording in its filtered or unfiltered form. By default, Generate script(s) after the wizard finishes is selected, which will automatically launch the Generate Script from Recording wizard when you complete the recording process.
    Recording complete panel in the Create a New Recording wizard
  19. Click Finish. The Generate Script from Recording wizard opens immediately if the Generate script(s) after the wizard finishes option was selected in the previous step.

Generating a Script from your Recording

Recording a web session simply creates a raw recording. You use the Eggplant Performance Web script generator to create the final Web script with the help of the Generate Script from Recording wizard.

To generate a script from your recording:
  1. Run the Generate Script from Recording wizard. It opens to the Choose a language panel. As described in the previous section, the Generate Script form Recording wizard opens automatically when you choose Generate script(s) after the wizard finishes on the Recording complete panel in the Generate a New Script wizard.
  2. Select the programming language (Java or C#) in which you would like your script generated and click Next. The Choose a Custom Virtual User type panel opens. The examples below use a C# VU.
  3. Choose Virtual User Type panel in the Generate Script from Recording wizard
  4. Select the Web VU you created from the Virtual User Type list and click Next. The Enter new script settings panel opens.
    Enter new settings panel in the Generate a Recording wizard
  5. Select the transactions from your recording that you would like to include in the generated script and click Next. The Choose which script generation rules to apply panel opens.

    The Choose Generation Rules screen

  6. Click the Add (green plus) button to add a new generation rule for your VU. The Generation Rules Wizard opens to the Select Rule Type panel. Generation Rules enable you to automatically handle tasks such as parameterization, correlation, and validation each time a new script is generated.

    The example below uses the Verify Contains rule type that lets you validate if the server's responses to the virtual user's (VU's) requests are accurate during the test. By verifying the a short section of the page content, the virtual users can report errors if something goes wrong (for example, if the users are unable to view the page they're expecting to see).

    Select  rule type panel  in the Generation Rules Wizard

  7. From the Rule Types pane, select Verification Rules > Verify Contains rule and then click Next. The Verify Contains rule is used to ensure that the server’s responses to the Virtual User’s requests are accurate. The Set the expected response content panel opens.
  8. Select expected resopnse content panel in the Generation Rules Wizard

  9. Click View Recording to use the Web Log Viewer to see the requests and responses made during the recording to find the appropriate text to enter in the Text field. Close or minimize the Web Log Viewer window when you finish viewing the recording.
  10. Click Next on the Select Rule Type panel. The Select the success/failure options panel opens.
  11. Select Success/Failure options in the Generation Rules Wizard

  12. From the Action to take on failure drop-down list, select the action that you want to occur if the content cannot be verified. For example, Generate a warning message and continue causes a warning message to appear in the run-time results, but the execution otherwise continues. Click Next to go to the Create a request filter panel.
  13. From the Request filter panel, select the appropriate filter option. For example, select Only apply rule to requests that match the following conditions and click the Add button to create request filter that limits the requests to which your generation rule is applied. The Create a request filter dialog box opens.
  14. Create Request Filter panel in the Generation Rules Wizard with filters added

  15. Review the matching requests and adjust the request filters until the requests you want are displayed. When you are satisfied with the filters, click OK to create your filter. The filter and its matching requests are added.
  16. Click Next. The Enter a name for this rule panel opens.
  17. Rule Name panel in the Generation Rules Wizard
  18. Review the summary of your new generation rule and click Finish to add your completed rule. The new rule is displayed on the Choose which script generation rules to apply panel of the Generate Script from Recording wizard.
  19. Click Next. The Advanced web script generation options panel opens. For our example, we accept all the default values on this panel and its tabs.
  20. Click Generate to generate your script. The Generation in progress panel opens showing you the script generation progress. When it finishes, you see a message Script generation complete! If you see errors or a failure instead, troubleshoot accordingly.
  21. When the script generation finishes, click Finish. Your new script will open in the main window and appear under Scripts in the Project tree view. You can see the rules your script was generated with in the main window.
  22. Click Next on the Select Rule Type panel. The Set the expected response content panel opens.
  23. Record and generate at least one more script so that you can create a workflow and then proceed to the next section.

Creating a Workflow

You can create a simple test consisting of one script directly, without using a workflow. However, using a workflow gives you a greater degree of control over your scripts when you run a test. In a workflow, you can place scripts in three different categories:

  • Initial: Scripts placed in the initial section run only once at the start of a test.
  • Repeated: Scripts in the repeated section are iterated the number of times specified in the Virtual User Group Runtime Settings.
  • Final: Scripts in the final section run once at the end of the workflow.

To create a workflow:

  1. Right-click Workflows in the Project tree, then select New workflow. The Create a Workflow dialog box opens.
    The Create a Workflow dialog box in [General.EpP%] [General.Studio%]
  2. Provide a name for your workflow.
  3. Build the desired workflow from your scripts using the Initial, Repeated, and Final selectors, then click OK. Your new workflow opens in the main Studio window and is listed under Workflows in the Project tree.

For more detailed information on workflows, see Working with Workflows.

Creating and Configuring a Test

Designing a test allows you to configure how your VU scripts will be used during the execution. You can reuse and configure a set of scripts in different ways to allow an infinite number of different tests.

To create and configure a test:
  1. Right-click your new workflow and select Create Test. The Create test from script dialog box opens.
  2. Enter a name for the test and click OK. In our example, we entered a name but accepted the default group. The test opens in the Main window.

    Newly created test in[General.EpP%] [General.Studio%]

  3. Double-click the VU Group for your new workflow. The Group Specification panel opens.
  4. On the Virtual Users tab, increase the number of VUs in the VU group to a conservative number, such as 5, so you don't tax the localhost Injector. Also be mindful of the maximum VUs allowed by available licenses.

    Virtual Users tab on the Group Specification dialog box

  5. On the Iterations tab on the Runtime Settings tab, raise the number of iterations to 20 to increase the amount of data gathered and available for later analysis, and click OK to commit the changes.
    Iterations tab in the Group Specification dialog box for a test

Building Your Project

You must build your project to ensure it compiles correctly.

To build your project:

  1. Click Build in the toolbar to build your project.
    The [General.EpP] [General.Studio]toolbar with the Build icon highlighted
  2. Confirm that the build was successful.
    Build output window showing successful build in Eggplant Performance Studio

Your test should now be ready to run. Continue to Running an Eggplant Performance Test in this sample quick start guide for information about running your test.

 

This topic was last updated on January 13, 2022, at 02:42:23 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2022 Eggplant