Search code examples
seleniumautomationnunit

How to save NUnit test results to xml?


I am trying to learn Selenium in C# and everything is going smooth so far. But I wanted to export reports to xml. Looked over some answers but did not find any exact answer. Seems like it is done with NUnit console, but what command is not specified anywhere. Would appreciate even for useful links.

Using:

  • VS 2017
  • NUnit 3.11.0
  • Selenium 3.14.0

Have only 1 Test

    [Test]
    public void Open()
    {
        IWebDriver driver = new ChromeDriver();
        driver.Navigate().GoToUrl("https://google.com");

        Assert.AreEqual("Google", driver.Title);

        driver.Close();
        driver.Quit();

    }

Solution

  • So after some research I found the answer. The commands is:

    nunit3-console "file.dll"
    

    DLL file can be found in bin\debug\projectname.dll after building the solution (CTRL+SHIFT+B).