Java Automation
๐ Table of Contents
๐งญ Selenium Automation with Java
๐ Web Services and REST API
๐ API Automation using REST Assured
This Java Automation course is crafted for experienced QA professionals, test automation engineers, and SDETs who want to go deeper into the design, structure, and scalability of test automation systems.
Youโll gain deep expertise in Core Java, Selenium WebDriver, REST Assured, and JUnit, with a strong focus on building robust, reusable, and maintainable automation frameworks for UI and API testing.
You will also learn how to plan for modular automation, manage test data, structure your codebase, and apply best practices to ensure high-quality and efficient testing.
โ Core Java Programming
๐ Category | Topics Covered |
---|---|
๐ ๏ธ Java Installation & Setup | - Java Installation - Environment Variables - Path and CLASSPATH |
๐ก Java Basics | - Introduction to Java - Setting up Java Development Environment - Writing your first Java program - Data Types and Variables: ย ย ย ย - Primitive and Reference Types ย ย ย ย - Variables and Constants |
๐ Control Flow | - If-Else, Switch - For, While, Do-While loops |
๐งฑ Object-Oriented Programming (OOP) | - Classes, Objects, Constructors - Inheritance - Method Overloading & Overriding - Polymorphism - Encapsulation - Abstraction (Abstract Classes & Interfaces) |
๐จ Exception Handling | - Types: Checked vs Unchecked - Try-Catch, Finally - Throw & Throws |
๐งบ Collections Framework | - List: ArrayList, LinkedList - Set: HashSet, TreeSet - Map: HashMap, TreeMap |
๐ Java I/O | - File Handling - Streams: Byte & Character |
๐งต Multithreading | - Creating Threads - Runnable Interface - Synchronization & Communication |
๐งฐ Utility Classes | - String, StringBuilder, StringBuffer - Wrapper Classes - Autoboxing/Unboxing |
๐งช TestNG/JUnit Framework
-
Unit Testing
- What is Unit Testing?
-
Setting up JUnit
- Using Maven
- Using Gradle
-
Annotations
@Test
@BeforeEach
@AfterEach
- Other useful annotations
-
Assertions
assertEquals
assertTrue
,assertFalse
assertThrows
assertNotNull
,assertNull
-
Parameterized Tests
- Running tests with multiple sets of data
- Using
@ParameterizedTest
,@ValueSource
,@CsvSource
-
Test Suites
- Grouping multiple test classes
- Running them together using
@Suite
-
Exception Testing
- Validating exceptions using
assertThrows
- Validating exceptions using
-
Nested Tests
- Organizing related tests within inner classes using
@Nested
- Organizing related tests within inner classes using
-
Mocking Dependencies
- Introduction to mocking frameworks (e.g., Mockito)
- Creating and injecting mocks
- Verifying interactions
-
Hands-on Practice
- Writing simple test cases
- Practicing with a sample Java class and methods
๐๏ธ SQL JDBC Programming
-
Introduction to SQL
- Overview of SQL and its importance in automation testing
- Types of SQL databases (e.g., MySQL, PostgreSQL, Oracle)
-
SQL Basics
- Understanding databases, tables, and records
- Data types in SQL
-
Basic SQL Commands
SELECT
statement for data retrievalWHERE
clause for filtering data- Sorting results with
ORDER BY
-
SQL Functions
- Common functions like
COUNT
,SUM
,AVG
,MIN
,MAX
- String functions (e.g.,
CONCAT
,UPPER
,LOWER
) - Date functions (e.g.,
NOW
,DATE_ADD
)
- Common functions like
-
Data Manipulation
- Inserting data using
INSERT INTO
- Updating data using
UPDATE
- Deleting data using
DELETE
- Inserting data using
-
Joins in SQL
- Understanding different types of joins:
INNER JOIN
,LEFT JOIN
,RIGHT JOIN
,FULL JOIN
- Retrieving data from multiple tables using joins
- Understanding different types of joins:
-
Aggregating Data
- Grouping data using
GROUP BY
- Filtering groups with
HAVING
clause
- Grouping data using
-
Indexes and Keys
- Understanding primary keys and foreign keys
- Using indexes for performance optimization
-
Basic Database Testing
- Verifying data integrity with SQL queries
- Validating test scenarios using SQL
- Common database testing use cases in automation
๐ฆ Maven Basics
- What is Maven? Benefits
- Installing Maven
- Project Structure and POM
- Adding Dependencies
- Maven Build Lifecycle
- Common Plugins
- Example Maven Project
๐งญ Selenium Automation with Java
-
Introduction to SQL
- Overview of SQL and its importance in automation testing
- Types of SQL databases (e.g., MySQL, PostgreSQL, Oracle)
-
SQL Basics
- Understanding databases, tables, and records
- Data types in SQL
-
Basic SQL Commands
SELECT
statement for data retrievalWHERE
clause for filtering data- Sorting results with
ORDER BY
-
SQL Functions
- Common functions like
COUNT
,SUM
,AVG
,MIN
,MAX
- String functions (e.g.,
CONCAT
,UPPER
,LOWER
) - Date functions (e.g.,
NOW
,DATE_ADD
)
- Common functions like
-
Data Manipulation
- Inserting data using
INSERT INTO
- Updating data using
UPDATE
- Deleting data using
DELETE
- Inserting data using
-
Joins in SQL
- Understanding different types of joins:
INNER JOIN
,LEFT JOIN
,RIGHT JOIN
,FULL JOIN
- Retrieving data from multiple tables using joins
- Understanding different types of joins:
-
Aggregating Data
- Grouping data using
GROUP BY
- Filtering groups with
HAVING
clause
- Grouping data using
-
Indexes and Keys
- Understanding primary keys and foreign keys
- Using indexes for performance optimization
-
Basic Database Testing
- Verifying data integrity with SQL queries
- Validating test scenarios using SQL
- Common database testing use cases in automation
๐ Web Services and REST API
- What are Web Services?
- REST vs SOAP
- Components of REST API
- HTTP Methods: GET, POST, PUT, DELETE, PATCH
- HTTP Status Codes: 1xxโ5xx
- Tools: Postman, curl
- Parsing JSON/XML
- Error Handling
- Examples using Flask & Express.js
๐ API Automation using REST Assured
-
What is REST-Assured?
- A Java-based library used to test RESTful APIs.
- Provides a domain-specific language (DSL) for writing readable and maintainable API tests.
- Integrates seamlessly with Java-based testing frameworks like JUnit and TestNG.
-
Setting up with Maven
- Add REST-Assured dependency in your
pom.xml
.<dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>5.3.0</version> <scope>test</scope> </dependency>
- Optionally include JSON/XML path and Hamcrest matchers for assertions.
- Add REST-Assured dependency in your
-
HTTP Method Testing
GET
: Retrieve data from an API.POST
: Send data to the server.PUT
: Update existing data.DELETE
: Remove data from the server.PATCH
: Partially update resources.
-
Validating Responses
- Status Code
- Validate HTTP response code (e.g., 200 OK, 404 Not Found).
- Headers
- Assert presence and values of headers like
Content-Type
,Authorization
, etc.
- Assert presence and values of headers like
- Body
- Validate fields in JSON or XML response using path expressions.
- Status Code
-
Authentication
- Basic Authentication
- Pass credentials using
.auth().basic(username, password)
.
- Pass credentials using
- Token-Based Authentication
- Use
.auth().oauth2(token)
for Bearer tokens (commonly used in REST APIs).
- Use
- Custom Headers
- Add custom
Authorization
headers when needed.
- Add custom
- Basic Authentication
-
Request Parameters & Payloads
- Query Parameters
- Use
.param("key", "value")
or.queryParam()
.
- Use
- Path Parameters
- Define placeholders in the endpoint URL.
- Request Body
- Send JSON, XML, or form data as payload using
.body()
.
- Send JSON, XML, or form data as payload using
- Query Parameters
-
Assertions with Hamcrest
- Use expressive matchers for validating response:
equalTo()
,hasItems()
,containsString()
, etc.
- Enables readable assertions like:
then().body("name", equalTo("John"));
- Use expressive matchers for validating response:
-
Logging and Configurations
- Enable request and response logging:
.log().all()
or.log().body()
- Configure timeouts, proxies, and base URI using
RestAssured.config
.
- Enable request and response logging:
-
File Uploads/Downloads
- Upload files using
.multiPart()
method. - Download files and validate content type, size, etc.
- Upload files using
-
TestNG / JUnit Integration
- Use REST-Assured inside test methods.
- Combine with test annotations for setup, teardown, and grouping.
- Create reusable test suites and CI pipelines.
-
Best Practices and Hands-on
- Use
RequestSpecification
andResponseSpecification
for reusability. - Externalize base URIs, endpoints, and payloads in config files or constants.
- Follow clear naming conventions and logging to maintain readable tests.
- Hands-on practice: Create CRUD tests against public APIs like
https://reqres.in
or your own mock server.
- Use
๐ Projects
- Project 1 - Java Selenium Automation
- Project 2 - Java Selenium Automation
- Project 3 - API Automation using REST Assured
- Project 4 - API Automation using REST Assured
๐ฏ Mock Interviews
๐ ๏ธ IDE Setup
- Visual Studio Code
- IntelliJ
- Useful Plugins