Book Image

Hands-On Automation Testing with Java for Beginners

Book Image

Hands-On Automation Testing with Java for Beginners

Overview of this book

Java is one of the most commonly-used software languages by programmers and developers. Are you from a non-technical background and looking to master Java for your automation needs? Then Hands-On Automation Testing with Java for Beginners is for you. This book provides you with efficient techniques to effectively handle Java-related automation projects. You will learn how to handle strings and their functions in Java. As you make your way through the book, you will get to grips with classes and objects, along with their uses. In the concluding chapters, you will learn about the importance of inheritance and exceptions with practical examples. By the end of this book, you will have gained comprehensive knowledge of Java.
Table of Contents (17 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Preface

Java is one of the most commonly used software languages by programmers and developers. Are you from a non-technical background and looking to master Java for your automation needs? Then this book is for you.

This book is a guide that describes efficient techniques for effectively handling Java-related automation/projects. You will learn how to handle strings and their functions in Java. As we move, you will get to grips with classes, objects, and their usage. This book will help you understand the importance of inheritance and exceptions with practical examples.

By the end of this book, you will have gained a comprehensive knowledge of Java that will help you crack any job interview. 

Who this book is for

This book is intended for software developers who want to step into the world of software quality assurance and perform automation testing using testing frameworks. This book assumes Java programming experience for writing tests.

What this book covers

Chapter 1, First Programming Steps in Java, will introduce Java to you, along with the steps for installation and writing a small program to get started.

Chapter 2, Understanding Classes, Objects, and Their Usage in Java, will cover the basic concepts, such as strings and variables, and how they are different from each other. We will also discuss objects and their importance.

Chapter 3, Handling Strings and Their Functions in Java, will show you how to define a string using the String class, using an example to demonstrate.

Chapter 4Building Blocks for Java Programs – Loops and Conditions, will help you to understand important loops through examples.

Chapter 5, Everything You Need to Know About Interfaces and Inheritance, will cover some important concepts, such as interfaces, inheritance, function overloading, and function overriding.

Chapter 6Learning Everything about Arrays, will cover one of the most important concepts in Java, arrays; we will look at a few examples to understand the working of arrays.

Chapter 7, Understanding Date Class and Constructors in Java 11, will dive into the Date class and constructors in detail.

Chapter 8, Importance of the super and this Keywords and Exceptions in Java, is all about two keywords: super and this. We will pick examples and explain how they are put to use in various situations while writing our Java code.

Chapter 9, Understanding the Collections Framework, will dive deep into the collections framework, which consists of interfaces and classes. We will have a look at the three major collections: List, Set, and Map. In addition, ArrayList from the List collection, HashSet from the Set collection, and HashMap and HashTable from the Map collection, will be discussed in this chapter.

Chapter 10The Importance of the final Keyword, Packages, and Modifiers, will cover some important concepts, including the final keyword and importance of packages and modifiers in Java.

To get the most out of this book

Any prior knowledge of Java would be helpful during the course of the book.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Automation-Testing-with-Java-for-Beginners. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "To check whether Java is installed in our machine, navigate to C:\Program Files."

A block of code is set as follows:

package coreJava;
public class finaldemo {
           public static void main(String[] args) {
               //TODO Auto-generated method stub

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

protected void abc() {
    //TODO Auto-generated method stub
  System.out.println("Hello");
}

Any command-line input or output is written as follows:

$ import package.classname

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Keep clicking on Next so that Java is successfully configured in our machine."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.