Page History
...
In this tutorial, we will create some UI tests using NUnit and Selenium WebDriver for browser automation.
Note | ||||||
---|---|---|---|---|---|---|
| ||||||
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.
...
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).
Then you can configure the Test Explorer to run the NUnit tests while at the same time producing a NUnit XML report.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<NUnit>
<TestOutputXml>C:\TestResults</TestOutputXml>
</NUnit>
</RunSettings> |
References
- GitHub repository for this tutorial
- https://github.com/nunit/docs/wiki
- http://www.seleniumhq.org/docs/03_webdriver.jsp
- http://www.dotnetcatch.com/2016/11/23/selenium-with-net-core/
- http://toolsqa.wpengine.com/selenium-webdriver/c-sharp/iwebdriver-browser-commands-in-c-sharp/
- Configure unit tests by using a .runsettings file