Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

In this tutorial, we will create some UI tests using NUnit and Selenium WebDriver for browser automation.


Note
iconfalse
titleSource-code for this tutorial
typeInfo

Code is available in GiHub; the repo contains some additional tests beyond the scope of this tutorial and some auxiliary scripts.

Description

Our target application is a simple website providing a login page that we aim to test using positive and negative test scenarios.

...

After successfully running the Test Case and generating the NUnit XML report (e.g., nunit_webdriver_tests.xml), it can be imported to Xray via a CI tool (e.g. Jenkins), or the REST API, or by using the Import Execution Results action within the Test Execution.

...

Therefore, in the Story issue screen we can track the impacts of the test results on the calculated coverage, which in this case shows our Story as being "OK" due to the passing tests.


Tips

If you're using Visual Studio as your IDE, you need to have some dependencies/packages installed.

  • NUnit
  • NUnit3TestAdapter

These can be installed from Tools>NuGet Package Manager (using the console or the manager's UI).

Image Modified


Then you can configure the Test Explorer to run the NUnit tests while at the same time producing a NUnit XML report.


Code Block
languagec#
titlenunit.runsettings
collapsetrue
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
   <NUnit>
     <TestOutputXml>C:\TestResults</TestOutputXml>
 </NUnit>
</RunSettings>

Image Modified 


References