.Net Testing Tools/Strategies

:wave:
Hello, I made a previous post about starting an automation architect role in another board. However I wanted to post here to get some thoughts on testing in a .net environment.

I don’t know everything yet (haven’t started the job) however I do know they use .Net/C# in a “microservice” architecture type environment.

I’ve done some research (im new to C#/.Net, which I was upfront about) just to get an idea of what is out there. I will eventually be training manual testers as well, so im trying to also think of things that will be “friendly” to newcomers.

for UI automation I am used to Cypress, but from what i’ve seen Playwright is really honestly a little bit better from reading around. It does look interesting, although I do not like the .Net/C# version of it tbh I could always use it with typescript (which is what I prefer, and honestly probably easier for manual testers).

However on the API/Integration testing side it’s a little more confusing. Honestly I find microsoft documentation lacking a wee bit on the explanation of specific classes used in Integration testing (WebApplicationFactory/HttpCLient/etc…). Also one of the most popular API testing frameworks (RestSharp) seems to be not recommended anymore.

Does anyone have advice on what the latest/best tools people are using right now in .Net/C# Environment.
Thanks!

1 Like

I have been testing in the C# dotnet world for the last 5 years now.

Most of the apps that I have tested are built as well as tested using c#.

The desktop apps that I test are built using WPF.

I compiled resources for testing desktop apps with tools, strategies and ideas here: Desktop App Testing – All Resources Compiled - Testing Titbits | Rahul Parwal

Hope this helps you :slight_smile:

I use HttpClient for API tests, with Specflow for writing the tests BDD-style, and NUnit as the testing framework. It’s actually quite easy to use. The Gherkin part is also easy for manual testers as well.
For UI I don’t have any recommendations, I work on a desktop app so I don’t use something that would help you.

HttpClient seems to be the general consensus based off what i’ve read. Trouble is I can’t find a ton of good tutorial/documentation on it. Microsoft’s .net docs are kinda handwavey tbh. Any suggestions there? (I saw pluralsight had a course on it so I might check that out)

I’ve heard about Specflow as well, but for this particular position I don’t think they will have anyone that “takes advantage of it”.

I looked at Nunit as well, since thats one of the recommended frameworks for PlayWright (for UI testing).

as a side question: For someone new learning .net…when you initially started learning the framework did you find the documentation sort of lacking? I feel like it lacks examples and doesn’t really guide you very well but maybe that’s just me.

second side question: What is your thoughts on using MoQ? I’ve never been big on mocking unless it was an external library…but im curious of others thoughts on this.

I ran into the same problem, but once I started using it, it seemed pretty straight-forward. If you are already comfortable with .Net / C#, you should have no problems using it.
About NUnit, I think you can check the documentation from Microsoft or this tutorial.

I guess my issue perhaps is that I am going to be eventually training manual QA’s and I feel like HttpClient is pretty close to unit testing which may be difficult for newer QA’s that haven’t really automated before (as itll rely on probably understand the database/entity connection and controllers/models).

Which is “good” in the sense it gets them close to the code, but also bad if I want to focus on more outer black box testing.

1 Like

Yes, I see your point. But at some point, if you involve more people in this work, they will need to have basic programming understanding, too. Maybe for this specific case something like Specflow can come in handy?
Or you can check Bas Dijkstra’s library RestAssured.Net, he also provides some guide on how to use it for testing, could this be closer to what you are looking for? (I haven’t personally used it, but I know he documented it pretty well).

If this people just need to execute some calls every now and then, and not to develop at self-running automation suite:
How about this plugin for VS Code?
You can also combine multiple requests and handover data from a response to a request.

1 Like