Can Nunit console run multiple test lists at the same time?

1,229 views
Skip to first unread message

almightyjoygasm

unread,
Oct 16, 2014, 6:07:13 PM10/16/14
to nunit-...@googlegroups.com
Hi

I have a batch file which runs NUnit console, and points at a single test list follows:

nunit-console /result:console-testResults1.xml /work:C:\Selenium\TestResults /runlist:C:\Selenium\testlist.txt "C:\Selenium\VisualStudio\Automated Tests\Automated Tests\AutomatedTests\bin\Debug\AutomatedTests.dll"

I was hoping I could add an extra command to get the console to run 2 or more tests lists at the same time, then get the results and output to a single file. Ive tried...

nunit-console /result:console-testResults1.xml /work:C:\Selenium\TestResults /runlist:C:\Selenium\testlist.txt /runlist:C:\Selenium\testlist2.txt "C:\Selenium\VisualStudio\Automated Tests\Automated Tests\AutomatedTests\bin\Debug\AutomatedTests.dll"

... and variations of that. The above will just run testlist2. Other attempts dont work at all.

Is what im trying to do possible? Is there an alternative method that doesnt involve using the whole command lines again and having two results files produced for the seperate test lists.

Reason I want one results file out of this is because I will be automatically sending the results to stake holders, and dont want multiple e-mails or multiple results in one e-mail.


Best regards

AlmightyJoygasm


Charlie Poole

unread,
Oct 17, 2014, 12:57:09 AM10/17/14
to NUnit-Discuss

no, /runlist is not a repeatable option. You'll have to combine the lists.

--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss.
For more options, visit https://groups.google.com/d/optout.

almightyjoygasm

unread,
Oct 17, 2014, 8:26:08 AM10/17/14
to nunit-...@googlegroups.com

Hi Charlie

Thank you for your response.

When you say combine the lists, what do you mean specifically?

Best regards

AlmightyJoygasm

Charlie Poole

unread,
Oct 17, 2014, 10:14:39 AM10/17/14
to NUnit-Discuss

I mean put all the entries into s single file. What's the purpose of having two files?

almightyjoygasm

unread,
Oct 17, 2014, 12:11:25 PM10/17/14
to nunit-...@googlegroups.com

My attempt at some degree of parallel testing. 

By having two batch files like this;
nunit-console /result:console-testResults1.xml /work:C:\Selenium\TestResults /runlist:C:\Selenium\testlist.txt "C:\Selenium\VisualStudio\Automated Tests\Automated Tests\AutomatedTests\bin\Debug\AutomatedTests.dll"

and

nunit-console /result:console-testResults2.xml /work:C:\Selenium\TestResults /runlist:C:\Selenium\testlist2.txt "C:\Selenium\VisualStudio\Automated Tests\Automated Tests\AutomatedTests\bin\Debug\AutomatedTests.dll"

Then starting them at the same time with a batch file like this...

cd "C:\Automated Tests\Selenium"
start TestRun1.bat
cd "C:\Automated Tests\Selenium"
start TestRun2.bat


...over selenium grid I can run two test lists at the same time, even if the tests within each list are still run sequentially.

The problem is I get two XML results files and i'd prefer just one, hence trying to get /runlist:C:\Selenium\testlist.txt into the command line more than once.

Best regards
AlmightyJoygasm

Charlie Poole

unread,
Oct 17, 2014, 12:21:34 PM10/17/14
to NUnit-Discuss

Since NUnit 2 has no parallel capabilities, this wouldn't work even if you could use separate lists.

The Nunit 3.0 alpha runs fixtures in parallel, but there is as yet no way to order the individual tests. I think this may be the way for you to go in the future.

Charlie

ebfg

unread,
Oct 21, 2014, 12:56:11 PM10/21/14
to nunit-...@googlegroups.com
I have been successful at running NUnit 2.6.3 with C# in parallel in this manner:

1. Use TestFixture attributes with an browser enum on the constructor

    [TestFixture(Browser.Firefox)]
   
[TestFixture(Browser.Chrome)]
   
[TestFixture(Browser.IE)]
   
public class Web_Master_Header : SeleniumBaseClass
   
{
       
private IWebDriver driver;
       
       
public Web_Master_Header(Browser browser)
       
{
            driver
= StartBrowser(Web_Common.Application, browser);
       
}
 

2. Execute batch to start nunit-console in multiple instances (e.g. start %runnerpath%nunit-console.exe /runlist:TestListWeb_IE.txt ....) and another for FF or whichever browsers you have configured.

3. Populate separate "runlists" with each appropriate TestFixture you want to run 

TestListWeb_IE.txt:
SeleniumTests.Web.Master.Web_Master_Header(IE)

TestListWeb_FF.txt:
SeleniumTests.Web.Master.Web_Master_Header(FF)
.....

4. I've extended NUnit to write my own reports, but you could combine XML's into a single XML using nunit-results-1.1 or other

eddi-

Greg Young

unread,
Oct 21, 2014, 4:44:12 PM10/21/14
to nunit-...@googlegroups.com
Run as separate processes then try this after the join of forked processes. Eg output1.xml output2.xml output3.xml then

 xml_grep --pretty_print indented --wrap run-result --descr '' --cond "run-result" *.xml > output.xml

You might need to tweet above slightly as I believe run-result may not be the top heading just an example. You can the wire this up in a script easily to take for instance n args on the command line and automatically do this. Same is possible in windows though I gave a Linux/osx command line

Cheers,

Greg

--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss.
For more options, visit https://groups.google.com/d/optout.


--
Studying for the Turing test

Reply all
Reply to author
Forward
0 new messages