1
votes

I am automating web application using Selenium WebDriver with C# NUnit Framework and able to generate report in XML format when run test using NUnit GUI or NUnit Console.

I am looking how to generate report while running test using Nunit Test Adapter (Visual Studio 2015 ).

Can any help on same, it would be highly appreciated.

Thanks, Sadik

2

2 Answers

3
votes

The code to create an XML formatted output report is in an extension, which is not included in the NUnit adapter. Because, it is after all only an "adapter" I felt that users wouldn't want native NUnit output, but only whatever output Visual Studio provides.

Another reason it isn't there is that the adapter originally had no way for you to give it any options, so you couldn't actually ask for an XML report! However, the adapter does now read the runsettings file, which could be made to include the equivalent of the console --result option.

Bottom line, this would be a new feature and you would have to request it. If you do, be sure to use the correct repository: nunit-vs-adapter or nunit3-vs-adapter, depending on whether you use NUnit V2 or V3.

0
votes

Now it's possible to generate nUnit xml report even with vs-adapter. You'll need to create a .runsettings file with similar content:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
   <NUnit>
     <TestOutputXml>C:\TestResults</TestOutputXml>
 </NUnit>
</RunSettings>

More on this here. Also you may check this issue.

You will need to make sure VS notice your runsettings file.