Using eggPlant Functional with Visual Studio

TestPlant provides two ways to perform eggPlant Functional tests from within Microsoft Visual Studio:

  • Running eggPlant Functional Scripts from Visual Studio: Use the information shown here to configure eggPlant Functional test scripts to run a basic unit test from a Visual Studio test project.
  • Using the eggIntegration for Visual Studio: Use the information shown here to install and configure eggIntegration for Visual Studio to run eggPlant Functional test scripts as generic tests from a Visual Studio test project. The eggIntegration for Visual Studio is only available for Visual Studio 2013 Premium or Ultimate edition.

Running eggPlant Functional Scripts from Visual Studio

The eggPlant Functional application provides two available integration approaches, command line and XML-RPC using eggDrive, which you can use to run eggPlant Functional scripts from Visual Studio and other test execution tools. Use the information shown here to configure a Visual Studio test project to run eggPlant Functional scripts using eggPlant's command line or XML-RPC interfaces.

Adding Tests to Visual Studio

You must create a test project in Visual Studio to run eggPlant Functional tests:

  1. From the main menu, select File > New > Project.

    Creating a New Project

  2. In the left sidebar of the New Project dialog box, select Visual C# > Test.
  3. In the main window, choose Unit Test Project.
  4. Make the selection shown below to create a new Basic Unit Test item in Visual Studio:

    Creating a basic unit test in Visual Studio

  5. After the project is created, delete the generated UnitTest1.cs file.

Read the following information to help you decide which integration approach is right for you:

  • Integration Option 1: Command Line

    • It uses standard command line syntax.
    • It is available for all eggPlant Functional license types.
    • It automatically starts and stops the eggPlant process as at the beginning and end of the script execution.
    • It assumes that you installed eggPlant Functional on the same machine as Visual Studio.
  • Integration Option 2: XML RPC using eggDrive

    • It leverages XML-RPC libraries to interface between eggPlant Functional and your test execution harness/tool. XML-RPC libraries are available for most popular scripting languages, including C#, Ruby, Java, Python, and more.
    • It is available with Team eggPlant Functional licenses or eggDrive-enabled node-locked licenses.
    • It runs as a web service on your internal network and can be leveraged by a test harness that runs on a machine that is separate from eggPlant Functional.
    • The eggPlant Functional application must be running in eggDrive mode for the test harness and tool to communicate with it.

Using the eggIntegration for Visual Studio

Only use the eggIntegration for Visual Studio if you plan to integrate eggPlant Functional with Visual Studio version 2013.

Use eggIntegration for Visual Studio, an extension to Visual Studio, to run eggPlant Functional test scripts as generic tests from a Visual Studio 2013 test project. Teams that use the Microsoft application lifecycle management (ALM) systems of Team Foundation Server (TFS) or Visual Studio Online can install this extension, then execute eggPlant Functional tests from Microsoft Test Manager or from a Visual Studio build.

Integrate the Visual Studio generic tests that call eggPlant Functional scripts into the standard Microsoft ALM workflows in the same way as any other Microsoft ALM automation test. For information about running Visual Studio tests, see the Microsoft documentation:

Requirements for eggIntegration for Visual Studio

Make sure your system meets the minimum requirements to run eggIntegration for Visual Studio:

Note: Visual Studio Professional, Express Editions, Community Editions, or Microsoft Test Professional do not support creating generic tests.

Installation

Download eggIntegration for Visual Studio from the TestPlant eggIntegration downloads page. As a user with local administrator permissions, execute eggIntegrationVS_setupX.exe (where X is a version number), then follow the steps in the Setup wizard. On the final screen, make sure you allow the wizard to install the Visual Studio Packages on completion.

By default, eggIntegration for Visual Studio is installed to C:\Program Files (x86)\eggPlant Visual Studio Integration. However, you can change this location in the Setup wizard. The Visual Studio package installer is copied to the same folder in which you install the application. Manage packages from the main menu in Visual Studio by going to Tools > Extensions and Updates. The Extensions and Updates dialog box lets you disable or uninstall packages.

Adding Tests to Visual Studio

You need to create a test project in Visual Studio to run tests. From the main menu, select File > New > Project. In the left sidebar of the New Project dialog box, select Visual C# > Test, and in the main window, choose Unit Test Project. You can also select Visual Basic, but not C++. When the project is created, you can delete the generated UnitTest1.cs file.

Note: The project must be a test project. Otherwise, you cannot execute the tests even though you can add them to a project.

Creating a new test project in Visual Studio to use for eggIntegration with eggPlant Functional

Creating a new test project in Visual Studio

After you open the project, select Tools > eggPlant Functional Tests from the main menu. The following dialog box is displayed:

eggPlant Functional Generic Test Creation dialog box in eggIntegration for Visual Studio

If you select Run scripts using eggPlant Drive mode and a Host that is a remote machine, then the suite path browse button and Add scripts button are disabled. With this setup, you must manually enter the scripts and suite path on the remote machine. Selecting the option to run eggPlant Functional scripts on the local machine uses command-line execution of eggPlant Functional.

To add scripts to a test, click the Add scripts button. You can also click in the bottom blank row of the Script list, then type a new script name. To edit an existing script, double-click a row in the Script list. You need to enter only the name of the script in the suite.

The dialog box saves the selected settings for the user between sessions. After you select the suite and scripts and click OK, a generic test is created in the project for each script:

A generic test in Visual Studio for eggPlant Functional scripts

To open the Test Explorer window, select Test > Windows > Test Explorer from the main menu. The Test Explorer window opens in the left sidebar of Visual Studio.

Open or double click a generic test in the Solution Explorer in the right sidebar to view or edit the command-line arguments for RunEPFScriptVS.exe, which is the process that executes the script and collects the results.

If you have a host:port specified, the execution uses eggDrive. Otherwise, it runs eggPlant Functional through the command line on the local machine.

When you’re running through eggDrive, RunEPFScriptVS.exe uses XML-RPC to connect to eggPlant Functional. It selects the suite and calls RunWithNewResults scriptName.

If a host argument is not given, the script executes by calling RunScript.bat with the command line arguments:

runscript.bat "fullScriptPath" -GlobalResultsFolder Results [optional other parameters]

Running Tests

To begin execution of your test, right-click a test in the Test Explorer window or use one of the Run menu items.

The eggPlant Functional script log output is translated into the Visual Studio format and copied to the Visual Studio test location. Click the Output link at the bottom of the Test Explorer window to see the results, errors, and any screenshots. The results files created by eggPlant Functional are not deleted, so you can still view script results in the eggPlant Functional UI as well.

To run tests from Microsoft Test Manager, you must set up a test controller and test agents as described in the Microsoft documentation, Setting Up Test Machines to Run Tests.

 

This topic was last updated on June 16, 2017, at 09:42:21 AM.