Skip to content

testingbot/nunit-example

Repository files navigation

Tests

TestingBot - NUnit

TestingBot provides an online grid of browsers and mobile devices to run Automated tests on via Selenium WebDriver. This example demonstrates how to use NUnit to run a test in parallel across several browsers.

Environment Setup

  1. Global Dependencies

    • MS Visual Studio 2022 or later.
    • Install the NUnit and NUnit3TestAdapter packages through NuGet
  2. TestingBot Credentials

    • Add your TestingBot Key and Secret as environmental variables. You can find these in the TestingBot Dashboard.
    $ export TESTINGBOT_KEY=<your TestingBot Key>
    $ export TESTINGBOT_SECRET=<your TestingBot Secret>
    
  3. Setup

    • Clone the repo
    • Open the solution NUnit-TestingBot-Sample.sln in Visual Studio 2022 or higher
    • Build the solution

Running your tests from Test Explorer via NUnit Test Adapter

Click Run Unit Tests, you will see the test result in the TestingBot Dashboard

Parallel testing

There's an example on how to perform parallel testing. This will run two or more tests simultaneously, shortening the total test duration. To run the Parallel test, please use this command:

dotnet test --filter "Parallel"

Resources