Skip to content

A robust test automation framework built with Selenium WebDriver and Java, following industry best practices and design patterns.

License

Notifications You must be signed in to change notification settings

kasun-m-rathnayaka/Selenium-Test-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selenium Java Automation Framework

A robust test automation framework built with Selenium WebDriver and Java, following industry best practices and design patterns.

Features

  • Page Object Model (POM) design pattern implementation
  • Data-driven testing capability
  • Configurable test execution for multiple browsers
  • Logging mechanism for better debugging
  • Custom waits and utilities

Prerequisites

  • Java JDK 11 or higher
  • Maven 3.6.3 or higher
  • Edge browser
  • IDE (IntelliJ IDEA recommended)

Project Structure

src
├── main/java
│   ├── pages          # Page Object classes
│   └── config         # Configuration files
└── test/java
    └── tests          # Test classes

Getting Started

  1. Clone the repository:
git clone https://github.com/yourusername/selenium-java-automation.git
  1. Install dependencies:
mvn clean install
  1. Update config.properties with your test environment details:
browser=chrome
headless=false
baseUrl=https://your-application-url.com

Running Tests

Execute all tests:

mvn test

Run specific test suite:

mvn test -DsuiteXmlFile=testng.xml

Best Practices Implemented

  • Explicit waits instead of implicit waits
  • Centralized configuration management
  • Proper exception handling
  • Clean and maintainable code structure
  • Regular dependency updates
  • Comprehensive logging

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Common Issues and Solutions

  • WebDriver initialization fails: Ensure you have the latest browser drivers installed
  • Tests are unstable: Implement proper waits and synchronization
  • Test data issues: Use proper data management through external files

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

A robust test automation framework built with Selenium WebDriver and Java, following industry best practices and design patterns.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages