navnkmr1032778/Java_Selenium_API

★ 0Forks 0GitHub ↗Compare

README

Java Automation Framework

This project is a hybrid automation framework built using Java supporting both UI and API automation.

Tech Stack

  • Java 17
  • Selenium WebDriver
  • RestAssured
  • TestNG
  • Maven
  • JSON Schema Validation

Framework Overview

The framework supports:

  • UI Automation using Selenium WebDriver with Page Object Model
  • API Automation using RestAssured
  • Test execution using TestNG
  • Build management using Maven

Note: UI tests are executed using Chrome Mobile Emulator Mode to simulate mobile browser behavior.

Project Structure

JavaAutomation
├── src/test/java
│   ├── com.ipstack.tests
│   │   ├── APITests.java
│   │   └── BaseAPITest.java
│   ├── com.twitch.pages
│   │   ├── BasePage.java
│   │   ├── ChannelPage.java
│   │   └── HomePage.java
│   ├── com.twitch.tests
│   │   ├── BaseTest.java
│   │   └── VerifyChannel.java
│   ├── config
│   │   └── ConfigManager.java
│   ├── driver
│   │   ├── BrowserFactory.java
│   │   ├── DriverManager.java
│   │   └── WaitUtils.java
│   ├── testngListener
│   │   └── TestListener.java
│   └── utils
│       ├── Constants.java
│       ├── FileUtils.java
│       └── RestAssuredUtil.java
└── src/test/resources
    ├── schemas/schema.json
    └── config.properties

Test Scenarios Covered

UI Test Cases

Class: VerifyChannel.java

  • Verify if user is able to search channel on Twitch

Execution Environment:

  • Executed on Google Chrome Mobile Emulator for responsive/mobile validation

API Test Cases

Class: APITests.java

Implemented API validations for IPStack APIs:

  • Verify if Standard IP lookup with valid IP
  • Verify if Standard IP lookup with invalid IP
  • Verify if Standard IP lookup fails with invalid accessKey
  • Verify if Standard IP lookup fails without mandatory field

Note: API response validation is performed using JSONPath to verify response fields and expected values.


Execution Commands

Run complete suite using TestNG XML

mvn clean test -DsuiteXmlFile=testng.xml

Run all tests

mvn clean test

Run single UI test

mvn test -Dtest=VerifyChannel

Run single API test

mvn test -Dtest=APITests

Run multiple classes

mvn test -Dtest=VerifyChannel,APITests

Features Implemented

  • UI Automation using Selenium WebDriver
  • API Automation using RestAssured
  • Chrome Mobile Emulator execution for UI tests
  • Page Object Model design pattern
  • Reusable Driver Management
  • Wait Utilities
  • Configuration Management using ConfigManager
  • JSON Schema Validation for API responses
  • TestNG Listener implementation
  • Maven based execution

Future Enhancements

  • Jenkins CI/CD integration
  • Docker support
  • Reporting integration (Extent Reports / Allure)

Author: Narendra Sharma

Contributors

narendrasharma13

Issues