O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hands-On Automation Testing with Java for Beginners

Book Description

Learn Java programming concepts to design automation testing frameworks

Key Features

  • Learn to use Java program logic in application testing
  • Understand various test-driven development concepts with Java tools
  • Master Java with lots of programming examples

Book Description

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.

What you will learn

  • Understand the practical usage of Java conditions and loops
  • Write any Java program logic with strategies, tips, and tricks
  • Leverage advanced topics in Java collections to solve Java-related problems
  • Understand and use objects, classes, methods, and functions in Java
  • Build Java automation frameworks from scratch
  • Obtain knowledge of Java object-oriented programming (OOP) concepts with practical implementations

Who this book is for

Hands-On Automation Testing with Java for Beginners is for software developers who want to step into the world of software quality assurance and perform automation testing using various testing frameworks. Prior experience of writing tests in Java is assumed.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Automation Testing with Java for Beginners
  3. Packt Upsell
    1. Why subscribe?
    2. Packt.com
  4. Contributors
    1. About the author
    2. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  6. First Programming Steps in Java
    1. An introduction to Java and its installation
    2. Working with the Java editor tools
    3. Writing your first executable program in Java
    4. Summary
  7. Understanding Classes, Objects, and Their Usage in Java
    1. Difference between strings and variables
    2. Using methods
    3. Importance of classes and objects in Java
      1. Creating an object in Java
      2. Accessing an object in Java
      3. Accessing a method in a different class
    4. Summary
  8. Handling Strings and Their Functions in Java
    1. Introducing strings
      1. Defining the String literal
      2. Creating an object of the String class
    2. The String class and its methods
    3. Reversing a string's logic
    4. Summary
  9. Building Blocks for Java Programs – Loops and Conditions
    1. The for loop
    2. if...else condition
      1. Bringing the if...else condition in the for loop
    3. The while loop
      1. The do...while loop
    4. Nested loops
      1. Example 1
      2. Example 2
      3. Example 3
    5. Summary
  10. Everything You Need to Know About Interfaces and Inheritance
    1. Interfaces
      1. Using interfaces with a traffic light system
    2. Inheritance
      1. More on inheritance
    3. Function overloading
    4. Function overriding
    5. Summary
  11. Learn Everything about Arrays
    1. Arrays and their usage in Java programs
    2. Ways to initialize arrays and assign objects
      1. Multidimensional arrays
    3. Logic programming on multidimensional arrays
    4. Practice exercises
      1. Print the smallest number in a 3 x 3 matrix
      2. Displaying the largest number from the column with the smallest number
      3. Swapping variables with/without the temp variable
    5. Summary
  12. Understanding Date Class and Constructors in Java 11
    1. The Date class
    2. The Calendar class
    3. Constructors
    4. Parameterized constructors
    5. Summary
  13. Importance of the super and this Keywords and Exceptions in Java
    1. The super keyword
    2. Practical usage of the super keyword
      1. Using the super keyword for methods
      2. Using the super keyword for constructors
    3. Importance of the this keyword
    4. Different kinds of exception
    5. The try...catch mechanism to handle exceptions
    6. Importance of the finally block in Java
    7. Summary
  14. Understanding the Collections Framework
    1. The collections framework
    2. The List collection
      1. The ArrayList class
      2. Example of ArrayList
    3. The Set collection
      1. Using iterator
    4. The Map collection
      1. HashTable
        1. Synchronized or thread-safe
        2. Null keys and null values
        3. Iterating values
    5. Summary
  15. The Importance of the final Keyword, Packages, and Modifiers
    1. The final keyword
    2. Packages
    3. Modifiers in Java
      1. default
      2. public
      3. private
      4. protected
    4. Summary
  16. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think