Skip to content

thanhthanh0535/Selenium_PJ1_Csharp

Repository files navigation

Web Automation Framework — Selenium + C#

UI test automation framework for Facebook, built with Selenium WebDriver and NUnit in C#. Uses the Page Object Model pattern to keep tests maintainable as covered flows grow.


What this project does

Covers multiple real user flows — login/logout, search, posting, commenting, and form validation — across parameterized test scenarios. Tests run in parallel to cut execution time, and failures automatically capture timestamped screenshots so defects can be reproduced quickly without re-running manually.


Results

  • 95%+ pass rate across 50+ parameterized test scenarios
  • 60% reduction in total suite runtime via NUnit parallel execution
  • 40% faster defect reproduction through automated screenshot capture on failure
  • Validated functional requirements across multiple browser environments

Tech stack

  • Selenium WebDriver — browser automation
  • NUnit — test runner with parallel execution support
  • C# / .NET — framework language
  • Page Object Model — design pattern for maintainable test structure

Project structure

PageObject/             # Page classes (one per UI page)
TestScript/             # Test cases organized by feature
Utilities/              # Shared helpers, config, base setup
BaseTest.cs             # Common setup and teardown
Parallel_Testing.cs     # NUnit parallel execution config
screenshots/            # Auto-captured failure screenshots

Run locally

Prerequisites: .NET SDK, Chrome browser

dotnet restore
dotnet test

To run a specific test class:

dotnet test --filter "ClassName=LoginTests"

Design decisions worth noting

Page Object Model — each page of the app has its own class. Test scripts call page methods instead of raw selectors, so when the UI changes, only the page class needs updating — not every test that touches that page.

Parallel execution — NUnit fixture-level parallelism cuts the full suite runtime significantly. Test isolation is enforced at the class level to avoid shared state conflicts.

Failure screenshots — every failed test saves a timestamped screenshot automatically. This was one of the more practical additions: it cuts the time spent reproducing intermittent failures in half.


Connection to DevOps

This project is grounded in QA, but the underlying skills transfer directly: writing maintainable code, designing for reproducibility, reducing manual toil, and building feedback loops that catch problems early. Those are the same goals in DevOps — just applied at the infrastructure layer instead of the test layer.

Planned improvements:

  • Add GitHub Actions workflow to run tests on every pull request
  • Containerize with Docker to remove local environment dependencies
  • Generate and publish HTML test reports as pipeline artifacts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages