This project offers a structured framework for creating and executing automated test cases using Selenium and TestNG. It is designed to facilitate the automation of web application testing through a well-organized structure.
- Implements the Page Object Model for structured, reliable, and expandable test automation.
- Includes a
Configuration.properties
file that centralizes all environment variables.
- Provides a file reader to simplify the use of environment variables.
- Utilizes Selenium's Page Factory for efficient and easy-to-maintain page object initialization.
- Implements a browser factory to support running tests on multiple browsers.
- Maven 3.9.8
- Java 21.0.2
- Windows 11
- Chromedriver 114.0.5735.90
- Clone the repository:
git clone https://github.com/FC122/maven_selenium.git
- Navigate to the maven_selenium directory:
cd maven_selenium
- Install the project dependencies:
mvn install
- Run the tests:
mvn test
Ensure the configuration.properties file is correctly set up with all necessary environment variables. This file should be located in the src/main/resources directory and may include variables such as:
- browser: The browser to use for tests (e.g., chrome, firefox).
- url: The base URL of the application to be tested.
- timeout: The default timeout for implicit waits.
- Page Objects: Define web elements and actions for each page of your application in the src/main/java/com/yourcompany/pages directory.
- Test Cases: Create test cases in the src/test/java/com/yourcompany/tests directory.
To run specific test classes or methods, you can use the following Maven command:
mvn -Dtest=TestClassName test
Or to run a specific method in a test class:
mvn -Dtest=TestClassName#methodName test
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Make your changes.
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature
- Open a pull request
The MIT License (MIT) Copyright © 2024
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For any questions or issues, please contact filip.cica1234@gmail.com