This project focuses on automating UI testing for the website Automation Practice using Selenium with Java, implementing the Page Object Model (POM) design pattern. UI automation testing plays a critical role in ensuring the quality and reliability of web applications by automating the interaction with user interfaces. By utilizing Selenium, developers can simulate user actions across various browsers, ensuring compatibility and functionality across different platforms. The Page Object Model (POM) design pattern enhances test maintainability and readability by encapsulating web elements and their related functionalities into separate classes. This approach promotes reusability and reduces code duplication, leading to more efficient test development and maintenance.
- Automate the UI: Automate the UI for the website - http://automationpractice.com/index.php.
- Write Test Scripts: Write test scripts for two pages using the Page Object Model (POM).
- Test Scenarios: Each page must have five test scenarios, approved by the mentor.
- TestNG Implementation: Utilize TestNG for all test cases.
- Browser Independence: Ensure automation tests are browser-independent.
- Selenium: Selenium is an open-source tool used to automate web browsers. It provides a rich set of APIs for interacting with web elements and executing browser actions programmatically.
- Java: Java programming language is utilized to write Selenium test scripts. Java's robustness and platform independence make it a popular choice for building automation frameworks.
- Cucumber: Cucumber is employed as a tool based on the Behavior Driven Development (BDD) framework, facilitating the writing of acceptance tests for the web application. It allows test scenarios to be written in a human-readable format, promoting collaboration between technical and non-technical stakeholders.
- TestNG: TestNG is an open-source test automation framework for Java. It enhances automated tests by making them more structured, readable, maintainable, and user-friendly. TestNG provides features such as annotations, grouping, and parameterization, enabling developers to create comprehensive test suites.
- Page Object Model (POM): POM is a design pattern in Selenium that establishes an object repository for storing all web elements of a webpage. By encapsulating web elements and their related actions into separate classes, POM promotes code reusability, maintainability, and scalability.
Feature files in UI automation testing play a pivotal role in implementing Behavior Driven Development (BDD) practices. These files contain human-readable scenarios, outlining application behavior from an end-user perspective. By defining scenarios with Given-When-Then steps, feature files promote collaboration, clarity, and better test coverage. They serve as living documentation, facilitating continuous refinement of test scenarios as the application evolves. Overall, feature files bridge the communication gap between stakeholders and technical teams, fostering collaboration and driving quality in UI automation testing projects.
- The Signup Page to automate.
- The Scenarios decided for the Automation of the Signup Page.
- The Home Page Page to automate.
- The Scenarios decided for the Automation of the Home Page.
Please refer to the provided screenshots for the project output.
- Signup Page TestNG Report #01
- Signup Page TestNG Report #02
To get a copy of this project up and running on your local machine for development and testing purposes, follow these steps:
-
Clone this repository.
git clone https://github.com/SourabhGPatil/Capstone-Project
-
Install the necessary dependencies.
npm install
-
Configure the test environment.
- Ensure you have Java Development Kit (JDK) installed.
- Install Selenium WebDriver.
- Set up TestNG in your project.
- Install any required browser drivers (e.g., ChromeDriver, GeckoDriver).
-
Your Maven Project structure must look like this:
-
Build the Project: Inside the project directory, execute the following Maven command to build the project:
mvn clean install
This command will compile the source code, run tests, and package the project into a JAR file.
-
Run the Project: Execute the following command to run the test suite:
mvn test
TopJobs Inc. is a company aiming to develop an online job recruitment application that facilitates both employers and job seekers. The primary objective of this project is to create a RESTful API using Spring Boot and MySQL, enabling CRUD operations. This API will empower employers to post job openings while allowing applicants to apply for these positions. Moreover, automation of this API will be achieved using TestNG for efficient testing.
- Apache Maven: Maven is utilized for managing dependencies in Java-based projects, ensuring the appropriate JAR files are obtained for seamless integration.
- Spring Boot: Spring Boot serves as the foundation for building enterprise Spring applications, providing a robust framework for development.
- REST API: Representational State Transfer (REST) API conforms to REST architectural principles, enabling interaction with RESTful web services.
- MySQL: MySQL acts as the relational database management system (RDBMS) for storing and managing API data efficiently.
- Postman: Postman serves as a comprehensive API development tool, facilitating the creation, testing, and modification of REST APIs.
- Create a Spring Boot project using Spring Initializr.
- Configure and set up a MySQL database, defining necessary configurations.
- Design entity model classes to represent database entities.
- Implement service classes to handle business logic.
- Develop REST controller classes to define API endpoints and operations.
- Build and run the project to ensure functionality.
- Utilize Postman for testing, executing GET, POST, PUT, and DELETE request methods.
- Write test methods and execute them using TestNG for automation.
The project structure encompasses various components such as entity models, service classes, REST controllers, and configuration files. Refer to the provided screenshot for a detailed visualization.
The database schema consists of tables representing job and resume entities, along with their respective attributes. Below are the schema details:
- JobID: Unique identifier for each job.
- EmployerID: Identifier for the employer posting the job.
- Qualifications: Qualifications required for the job.
- Compensation: Compensation offered for the job.
- employer_name: Name of the employer.
- job_title: Title of the job.
- ApplicantID: Unique identifier for each applicant.
- JobID: Identifier for the job applied by the applicant.
- Skills: Skills possessed by the applicant.
- applicant_name: Name of the applicant.
- education_completed: Educational qualifications completed by the applicant.
- employer_name: Name of the employer.
- phone_no: Contact number of the applicant.
To begin, clone the project repository to your local machine using Git. Open your terminal and execute the following command:
git clone https://github.com/SourabhGPatil/Capstone-Project
Follow these steps to run the project on your computer:
-
Database Setup: Before running the project, ensure that you have MySQL installed on your system. Create a MySQL database and configure the necessary credentials. Update the database configurations in the project accordingly.
-
Project Configuration: Open the project in your preferred Integrated Development Environment (IDE), such as IntelliJ IDEA or Eclipse. Ensure that you have Apache Maven installed for dependency management.
-
Build the Project: Using Maven, build the project to resolve dependencies and compile the source code. Navigate to the root directory of the project in your terminal and execute the following command:
mvn clean install
-
Run the Application: After successfully building the project, run the Spring Boot application. Use the following command:
mvn spring-boot:run
This command will start the embedded Tomcat server, and your application will be accessible at the specified port (usually
http://localhost:8080/
). -
Testing with Postman: Once the application is up and running, you can test the REST API endpoints using Postman. Execute GET, POST, PUT, and DELETE requests to interact with the API and verify its functionality.
-
Automated Testing with TestNG: To perform automated testing, ensure that TestNG is configured in your IDE. Write test methods to cover various scenarios and execute them using TestNG. Refer to the provided TestNG report for insights into test results and coverage.
By following these steps, you should be able to clone the repository, set up the project, run the application locally, and perform testing using both Postman and TestNG.
TestNG report showcases the results of automated tests performed on the API. Refer to the provided screenshot for a comprehensive overview. - TestNG Report #01
For more detailed information and implementation, please refer to the project's source code.
- Special thanks to my Mentor Ms. Swati Ma'am for guidance and approval of test scenarios.
- Thanks to the developers of Selenium, Java, TestNG, and Cucumber for their valuable contributions to the field of automated testing.