Back to Resources

Blog

Posted August 13, 2020

The C# Selenium Sample Repo You Must Have

Nikolay Advolodkin shares about the C# Selenium sample repository and offers best practices to help anyone struggling with automation in C# to get started quickly and easily.

quote

Deep in the jungle of Github lives an excellent resource of Selenium C# test automation code. This repository answers some of the most burning questions about how to use Selenium with different automation frameworks. For example, did you know that NUnit can’t natively do method level parallelization, but MsTest can? Also, do you know how to do native app testing with Appium in C#? These questions as well as dozens of others can be answered here.

Production quality automation framework

Have you ever wanted an example of a production quality C# framework that runs cross-platform and in parallel?

Here’s such an example and it’s ready for you to pull down and run.

An example of a production quality C# framework that runs cross-platform and in parallel

How to run NUnit methods in parallel

Did you know that NUnit natively can’t run methods in parallel? Actually, you have to create a complicated and funky implementation that will look like this.

An example of how to run methods in parallel using NUnit natively

Using TestScope that looks like this:

How to run a test on real devices using Appium in Sauce Labs

Your test would look like this:

How to use Selenium W3C

This repository also has W3C covered. Below is an example of an Edge test using W3C.

So much more

This is just a small preview of all the best practices that you can find in the demo-csharp repository. Here is a small list of some of the most popular options:

Conclusion

The demo-csharp repository is totally open source and ready for you to explore it. The examples in this repository are crafted with extreme care. Our desire is to help anyone struggling with automation in C# to get started quickly and easily. Go and take a look around. And if you want to submit a pull request to add some examples, we definitely welcome those.

Nikolay Advolodkin
Principal Developer Advocate at Sauce Labs
Published:
Aug 13, 2020
Share this post
Copy Share Link
© 2023 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are registered trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.