Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
523 views
by
edited by
Hi all,

I am learning SpecFLow and using Nunit runner.

I have  3 feature files: feature1.feature, feature2.feature and feature3.feature

I tried using command line to run each feature:

nunit3-console.exe “C:\WebProject\bin\debug\Web.dll” --out=TestResult.txt --result=TestResult.xml-–testlist=”

C:\WebProject\Features\Feature1.feature"

But Nunit runner can not understand this file and it did not run any test case in this feature:

Run Settings
    DisposeRunners: True
    WorkDirectory: C:\Users\minhdoan\Desktop\IMTestAutomationFramework\packages\NUnit.ConsoleRunner.3.6.0\tools
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.5.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False
    NumberOfTestWorkers: 4

Test Run Summary
  Overall result: Passed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2017-03-06 10:08:12Z
    End time: 2017-03-06 10:08:13Z
    Duration: 0.674 seconds

Results (nunit3) saved as TestResult.xml

Please help instruct me how to configure NUnit runnerfor executing each feature!

Many thanks in advance!

Kind regards,

MinMin

2 Answers

0 like 0 dislike
by

I see that you do not have space between

result=TestResult.xml-–testlist

I think adding space should resolve your problem.

Like:

result=TestResult.xml -–testlist

Let us know your findings in comments.

by
Hi Jigar,
I have retried and result is same, 0 test cases run.

Thank you so much for your comment!
0 like 0 dislike
by

You should first create a text file with list of feature files.

E.g.

testslist.txt

that contains

C:\WebProject\Features\Feature1.feature

and then your command should look like.

nunit3-console.exe "C:\WebProject\bin\debug\Web.dll" --out=TestResult.txt --result=TestResult.xml -–testlist="testslist.txt"

Cheers!

by
Text file should have one test per line. E.g. if you want to include feature2.feature and feature3.feature. Your testslist.txt should have below content:

C:\WebProject\Features\Feature1.feature
C:\WebProject\Features\Feature2.feature
C:\WebProject\Features\Feature3.feature
by
Hi Jena,

Thank you so much for your comment!
I have tried and finally work with below command:
nunit3-console.exe "C:\WebProject\bin\debug\Web.dll" --out=TestResult.txt --result=TestResult.xml @"testslist.txt"
by
I am glad it worked! Kindly select the best answer.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...