Site Loader
Auckland, New Zealand
In this post we will discuss yet another useful feature introduced in NUnit 3.x where we can pass a parameter to NUnit test class of C# from Command Line Interface (CLI) using a new feature called –params

Passing parameters

Starting NUnit 3.x, there is an most awaited option introduced for Nunit-console runner, which is passing parameters to test method(s) via CLI using –params

What’s the use case of this?

Consider a scenario something like this, Lets say we have to test application with multiple browsers and we somehow have to parameterize the BrowserType like Firefox,Chrome,IE

Then, we can do it via CLI and pass the parameter to the whole framework to run test based on the parameter (browser type) that we passed. Here is the complete video of the above discussion Here is the complete modified code https://gist.github.com/executeautomation/bac7500ffdd2402eb6a98e4f83e28047 You can checkout the complete code from GitHub here  Thanks for reading the post and watching the video!!! Please leave your comments and let me know if there is anything I should update in this post. Thanks, Karthik KK

Post Author: Karthik kk

4 Replies to “Passing parameters to NUnit test via CLI using params”

  1. Hello, I just wanted to leave a comment saying the infromation was very helpful, but if you could change the NUnit version from 3.x to 3.4+ for the NUnit Version, to avoid confusion for future persons it would be much appreciated. Thanks a ton!

  2. Hello, I just wanted to leave a comment saying the infromation was very helpful, but if you could change the NUnit version from 3.x to 3.4+ for the NUnit Version, to avoid confusion for future persons it would be much appreciated. Thanks a ton!

Leave a Reply to Artur Cancel reply

Your email address will not be published. Required fields are marked *