Share this page

# Create a testing project in Visual Studio

In Visual Studio, on Windows OS, you can create NUnit or MSTest testing projects and test items using the installed templates.

In this topic:

## Create a project

If you are creating an NUnit project, make sure that you have a supported version of the NUnit framework installed. For details on supported NUnit versions, see the Support Matrix.

Note: In NUnit 3, the NUnit Runner and the NUnit framework are installed separately. Make sure to install the NUnit framework, preferably through the NuGet package manager.

1. Create a new project. Filter for the Functional Testing for Developers templates, and select either the FTD NUnit or the FTD MSTest project template.

2. To add a test item in the project, in the Solution Explorer, right-click the project and select Add Functional Testing for Developers.

Back to top

## Visual Studio template content

The NUnit/MSTest FTD project templates include the following:

- Reference to the HP.LFT.SDK and related HP.LFT.* elements (project template only)

- Reference to Microsoft.CSharp and, for NUnit projects, nunit.framework (project template only)

- App.config, which enables you to customize some test settings (project template only). For details, see Customize test settings.

- A basic FTDTest.cs template where you write your code (project and item templates).

  You can include multiple tests in one class, and you can use the Object Identification Center or Test Recorder to help generate the code.

  The exact structure of this template depends on whether you are using NUnit or MSTest. In both cases, they include attributes where you can define:

  Attribute | Description
  --- | ---
  Setup code | Runs once at the start of the class
  Setup code | Runs once at the start of each test
  Individual test units | The template includes a single `[Test]` (NUnit) / `[TestMethod]` (MSTest) attribute containing an empty `Test()` / `TestMethod()` method. You can rename this method to whatever you want to call your test. You can add multiple `[Test]` / `[TestMethod]` attributes if you want to include several tests in your class. Each `[Test]` / `[TestMethod]` attribute should declare a void test method that contains the main code for that test.
  Cleanup code | Runs at the conclusion of each test
  Cleanup code | Runs once at the end of the class

- UnitTestClassBase.cs, which controls what happens during the different phases of your run, including running and closing the runtime engine (project template only).

Example: A new OpenText Functional Testing for Developers NUnit project in Visual Studio:

- For details on using the MSTest framework, see the relevant MSDN documentation.
- For details on using the NUnit framework, see the NUnit documentation.

Back to top

Next steps:

- Test objects
- Add steps to your tests
- Run tests
- Analyze run results

https://admhelp.microfocus.com Functional Testing for Developers 8942
Tips to improve your search results... OpenText™ Functional Testing for Developers Help Center OpenText™ Functional Testing for Developers Help 25.2 All View Local Help Center View Online Help Center Version: