testNG equivalent for c#?

2,401 views
Skip to first unread message

ABostonGal

unread,
Jun 26, 2019, 10:05:56 AM6/26/19
to Selenium Users
My existing test code platform is in Java, Selenium and testNG. 

In my current situation, for some reason, some are making a shift c# to write test code and my concern is that testNG cannot be used with c#.

IS there an test framework that is the equivalent of testNG that could be used with c#?

I've become very attached to testNG and hate the idea of having to rework a significant test code base in c#...

Thanks!

Jim Evans

unread,
Jun 26, 2019, 10:38:04 AM6/26/19
to Selenium Users
While this is not directly related to Selenium, and is likely to be considered off-topic for this particular mailing list, it might be instructive to indicate what features of TestNG you find appealing, which you would require in a .NET test framework to find palatable.

ABostonGal

unread,
Jun 26, 2019, 11:12:41 AM6/26/19
to Selenium Users
Thanks - OK I see there is a testng- users group. sorry for the misplacement of my inquiry and thank you for your response! I''ll do a little more research.

As to what I find appealing about testNG would be the annotations. They allow you to designate tests, before methods, dependencies, parameterize tests via data providers, just to name a few features which appeal to me!

Advance Automation

unread,
Jun 26, 2019, 3:05:45 PM6/26/19
to Selenium Users
NUnit has those features.

John Doe

unread,
Jun 27, 2019, 5:22:15 AM6/27/19
to Selenium Users
There are at least 3 of them:

  1. MSTest
  2. NUnit
  3. xUnit.net
The most obvious choice would be the unit testing framework for your main project so you would have the same setup in terms of Continuous Integration

If you're free to choose - go for NUnit as it is more popular therefore it will have larger community hence you will have better support in case of troubles. 

foo.png


Check out Best practices for Selenium and Appium testing with C# and NUnit article for more information, hints, tips and tricks


ABostonGal

unread,
Jun 27, 2019, 9:56:52 AM6/27/19
to Selenium Users
Thank you. I am not doing unit testing. I am doing end-to-end regression testing on complete workflows...have you used the referenced for that purpose? 
I have of course heard and used some of them when I was doing unit testing - I used NUnit. 

Jim Evans

unread,
Jun 27, 2019, 10:51:40 AM6/27/19
to Selenium Users
Please don’t mistake the use of “unit testing” in the descriptions of these frameworks as the strict meaning of “unit testing.” Most people running so-called “end-to-end” testing do so via a framework that is at least nominally for unit testing. This description includes TestNG, which is also a “unit testing” (scare quotes intentional) framework.

Jay Whonder

unread,
Jun 27, 2019, 11:47:14 AM6/27/19
to seleniu...@googlegroups.com
Hey sorry i don't quite understand can you explain to me in layman's

El jue., 27 jun. 2019 9:51 a. m., Jim Evans <james.h....@gmail.com> escribió:
Please don’t mistake the use of “unit testing” in the descriptions of these frameworks as the strict meaning of “unit testing.” Most people running so-called “end-to-end” testing do so via a framework that is at least nominally for unit testing. This description includes TestNG, which is also a “unit testing” (scare quotes intentional) framework.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/289f6949-f1b6-404e-b33e-9625d3e76270%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Evans

unread,
Jun 27, 2019, 11:59:38 AM6/27/19
to Selenium Users
My point is that nearly all test runners for .NET-based (and Java-based) tests are designed and marketed for "unit tests." Even if they are for "unit tests," that does not mean they cannot or should not be used for UI-based tests, even though those tests are not, strictly speaking, "unit tests."

Remember that the strict definition of a unit test is that it has no dependencies outside the code the unit under test (the method, or class, or what have you), and that all such dependencies are replaced with mock or stub implementations. This implies no network access for a unit test, which further implies no use of a browser, so calling a test that uses Selenium a "unit test" would be inaccurate.

On Thursday, June 27, 2019 at 11:47:14 AM UTC-4, Jay Whonder wrote:
Hey sorry i don't quite understand can you explain to me in layman's

El jue., 27 jun. 2019 9:51 a. m., Jim Evans escribió:
Please don’t mistake the use of “unit testing” in the descriptions of these frameworks as the strict meaning of “unit testing.” Most people running so-called “end-to-end” testing do so via a framework that is at least nominally for unit testing. This description includes TestNG, which is also a “unit testing” (scare quotes intentional) framework.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

ABostonGal

unread,
Jun 27, 2019, 3:29:30 PM6/27/19
to Selenium Users
No - not confused.
Reply all
Reply to author
Forward
0 new messages