A robust, scalable, and modular automation framework leveraging Cucumber for BDD and Selenium WebDriver for browser automation. This project is designed for rapid test development, easy maintenance, and seamless integration into CI/CD pipelines.
- Behavior-Driven Development (BDD): Write human-readable test scenarios using Gherkin syntax.
- Modular Page Object Model (POM): Clean separation of test logic and UI interactions.
- Cross-Browser Testing: Easily extendable to run tests on Chrome, Firefox, Edge, etc.
- Test Data Management: Supports external test data sources (Excel, CSV, JSON).
- Advanced Reporting: Integrated with reporting tools (ExtentReports, Allure, etc.).
- Parallel Execution: Supports running tests in parallel using TestNG/JUnit.
- CI/CD Integration: Ready for GitHub Actions, Jenkins, Azure DevOps, etc.
CucumberSeleniumFramework/
├── src/
│ ├── main/
│ │ └── java/
│ │ └── com/
│ │ └── yourcompany/
│ │ └── pages/
│ │ └── utils/
│ ├── test/
│ │ └── java/
│ │ └── stepdefinitions/
│ └── resources/
│ └── features/
│ └── config/
├── pom.xml
├── README.md
- features/: Contains
.featurefiles written in Gherkin. - stepdefinitions/: Glue code to connect Gherkin steps with Selenium actions.
- pages/: Page Object classes for different web pages.
- utils/: Utilities, hooks, drivers, data providers, etc.
- Java 8+
- Maven or Gradle
- Chrome/Firefox/Edge browsers
- IDE (IntelliJ, Eclipse, VS Code)
git clone https://github.com/krishnaharshap/CucumberSeleniumFramework.git
cd CucumberSeleniumFrameworkmvn clean installor
gradle build- Update browser and environment settings in
/src/test/resources/config/config.properties. - Add/modify feature files in
/src/test/resources/features/.
mvn testgradle testmvn test -Dcucumber.options="src/test/resources/features/Login.feature"- After test execution, reports are generated in the
/targetfolder. - For Allure reports:
allure serve target/allure-results
- Fork the repository.
- Create a feature branch.
- Make changes and commit.
- Push to your fork.
- Open a Pull Request describing your changes.
- Follow the Page Object Model for maintainability.
- Write reusable step definitions.
- Keep feature files concise and descriptive.
- Use hooks for setup and teardown logic.
- Document new features and utilities.
- Ensure browser drivers are up to date and compatible with your browser version.
- Check
config.propertiesfor correct environment URLs and credentials. - Review logs in
/targetfor error details.