Automated UI testing project for a sample login page using Selenium WebDriver with C# and NUnit.
This project showcases a straightforward automated login test built with Selenium WebDriver in C#. It demonstrates:
- Browser automation using ChromeDriver
- Implementation of the Page Object Model (POM) design pattern for maintainable tests
- Use of the NUnit framework for structuring and running test cases
- Basic validation of successful login by verifying UI elements
- C# (latest features with .NET 9.0)
- Selenium WebDriver for browser automation
- NUnit testing framework
- ChromeDriver to drive Google Chrome browser
Before running the tests, ensure you have the following installed:
- .NET 9.0 SDK
- Google Chrome browser
- Compatible ChromeDriver version matching your Chrome browser
Follow these steps to set up and run the automated tests locally:
-
Clone the repository:
git clone https://github.com/r2dapps/LoginAutomation.git cd LoginAutomation -
Restore dependencies:
dotnet restore
-
Run the test suite:
dotnet test
| File | Description |
|---|---|
WebDriverFactory.cs |
Initializes and configures Selenium WebDriver instances |
LoginPage.cs |
Page Object Model representing the login page UI elements and interactions |
LoginTests.cs |
NUnit test class containing setup, teardown, and login tests |
This test case:
- Navigates to Practice Test Login Page
- Enters valid username and password credentials
- Clicks the login button
- Verifies successful login by checking the presence of the "Log out" button
Contributions are welcome! Whether it's fixing bugs, improving test coverage, or adding features:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to your branch (
git push origin feature/your-feature) - Open a Pull Request
Please ensure your code follows existing style and includes relevant tests.
This project is licensed under the MIT License. See the LICENSE file for details.
Developed and maintained by R2DApps GitHub: https://github.com/r2dapps
Thank you for checking out this project! Feel free to reach out if you have any questions or suggestions.