Roadmap › 5. Automation & Industry 4.0 › Step 52
QA

Test Automation — Selenium, Playwright, API and BDD with C#

Testing fundamentals and the test pyramid, NUnit/xUnit, Selenium WebDriver and locators, waits, Page Object Model, Playwright for .NET, API testing with HttpClient/RestSharp/Postman, BDD with Reqnroll (SpecFlow), data-driven tests, CI pipelines, flaky tests and the SDET interview questions.
What it is & where it is used

Test automation means writing code that tests software automatically and repeatably — UI tests that drive a browser, API tests that call endpoints, and unit/integration tests that check code directly. An SDET (Software Development Engineer in Test) or automation engineer builds and maintains these frameworks and runs them in CI/CD.

The test pyramid (Mike Cohn):

text
          /  UI / E2E  \        few — slow, brittle, test real user flows
         /  API / service \     more — fast, stable, test business rules through the API
        /    Unit tests     \   most — milliseconds, test classes/functions in isolation
LevelTools (.NET)Speed
UnitxUnit, NUnit, MSTest + Moq/NSubstitute + FluentAssertionsms
IntegrationWebApplicationFactory, Testcontainers, EF Core with real SQLseconds
APIHttpClient, RestSharp, Postman/Newman, Playwright APIseconds
UI / E2ESelenium WebDriver, Playwright, Cypress (JS)seconds–minutes
BDDReqnroll (successor of SpecFlow), Cucumberwraps any level
Performancek6, JMeter, NBomber, Azure Load Testingminutes
Versions & history
YearMilestone
2004Selenium created at ThoughtWorks (Jason Huggins)
2011Selenium 2 merges WebDriver
2016Selenium 3 (Selenium RC removed)
2018WebDriver becomes a W3C Recommendation
2020Playwright released by Microsoft (Node), .NET/Python/Java bindings in 2021
2021Selenium 4 — W3C protocol, relative locators, CDP access, new Grid
2023Selenium Manager (automatic driver download) built in from 4.6+
2024SpecFlow end-of-life announced; community fork Reqnroll becomes the .NET BDD standard; WebDriver BiDi rolling out
2025Playwright 1.5x — test agents, MCP integration; Selenium 4.3x with BiDi APIs
Lifecycle

Automation in the software testing life cycle (STLC):

  1. Requirement analysis — which acceptance criteria can be automated; risk-based selection.
  2. Test planning — scope, tools, framework design, environments, data strategy.
  3. Test design — test cases, data sets, page objects, API contracts.
  4. Framework & scripts — build reusable framework, write tests, code review them like product code.
  5. Execution — locally and in CI (on every PR: unit + API smoke; nightly: full regression; parallel/grid).
  6. Reporting — results, screenshots, videos, traces (Allure, ExtentReports, Azure Test Plans, Playwright HTML report).
  7. Maintenance — fix flaky tests, update locators, refactor; delete tests that no longer give value.
Tools used to develop
  • Test runners: NUnit, xUnit, MSTest; dotnet test.
  • UI: Selenium WebDriver (C#), Playwright for .NET (Microsoft.Playwright), Appium (mobile), WinAppDriver/FlaUI (Windows desktop).
  • API: HttpClient, RestSharp, Flurl, Postman + Newman, Playwright APIRequestContext.
  • BDD: Reqnroll (Gherkin .feature files with C# step definitions).
  • Assertions & mocks: FluentAssertions / Shouldly, Moq, NSubstitute, WireMock.Net (fake HTTP services).
  • Data & environments: Bogus (fake data), Testcontainers (Docker DBs), Selenium Grid / Selenoid, BrowserStack, Sauce Labs.
  • CI & reporting: Azure DevOps, GitHub Actions, Jenkins, Allure, ExtentReports.