0
I am using Nunit to run test scripts with Selenium Webdriver in C# (Visual Studio). The project uses the template Console Application
.
When running, the project displays a console (prompt) where I tell you which test environment and which test scripts will be run in sequence (1 or more).
During execution, if a Assert
of the failed test script, a log file is generated .txt
that records the exception
error. Then the next test runs until the tests of the queue are completed.
Problem: if another queue test fails, Nunit lists again in the log the previous test error plus the new error, and so on, enumerating the errors.
Log of Test 1:
There are differences between the Test Dropdown List on the Report Template Editor page and the reference list
Expected: True
But was: False
Log of Test 2:
Multiple failures or warnings in test:
1) The OK button was not visible to click on after 6 seconds
Expected: True
But was: False
2) There are differences between the Test Dropdown List on the Report Template Editor page and the reference list
Expected: True
But was: False
Excerpt that generates the log file:
StreamWriter sw = new StreamWriter("LogExecucao" + ".txt", true);
try
{
//scripts de teste
}
catch (Exception ex)
{
sw.WriteLine(ex.Message);
}
The same problem was reported at this link, but had no definitive answer. In this case, the user used the tool Gauge of Thoughtworks:
Someone in the community knows a way to record the exceptions without Nunit repeating them?