Preface

Quality is indispensable in every aspect of our lives, and software systems are no different. Throughout my career in software quality (spanning more than 15 years), I have constantly perceived the increasing appetite for achieving greater quality as part of the software development processes. As software applications grow more complex, the quality processes and tools around them have to keep up with all the intricacies. Finding problems in their products early helps organizations move faster and contributes to positive business outcomes.

Test automation is at the core of most of the quality endeavors within the software development life cycle. Test automation engineering is the process of enhancing the quality of software applications through automated tests. If test automation practices are correctly baked into the product development life cycle from the commencement of a project, it enables an invaluable feedback loop resulting in tremendous quality improvements. Test automation also reduces testing time, which allows resources to be used on other worthwhile efforts. Automation-first is the new norm across all software testing activities.

Testing is not a standalone activity and is viewed as an integral part of the software development process. Embedded quality teams have become the new normal, and hence communication and collaboration are key to the success of any test automation undertaking. There has been a paradigm shift in the way software developers view test automation and in how testers regard their own roles.

I will introduce you to various aspects of test automation in this book through simple definitions and practical examples. I will also review the different quality roles in the market and the skills it takes to be successful in each. The testing world is evolving at a great speed, and this book will help you solidify your fundamentals in test automation so that you can keep up with further progress in the field. Due to the cross-functional nature of the quality engineering discipline, it is necessary now more than ever to bridge the gap in test automation skills across software engineering and DevOps disciplines. This book will act as an excellent ally in filling this gap by helping you learn the multiple facets of test automation. I will provide relevant examples and guide you through various commonly used test automation frameworks in the industry.

Who this book is for

This will book will help anyone who wishes to enter the realm of software quality and test automation. It lays out the necessary fundamentals first and builds on them gradually. Experienced quality engineers, software engineers, and manual testers can gain practical insights throughout this book. Let’s see how this book helps each role:

  • Quality engineers: Quality engineers who have a test automation foundation but are seeking to upskill in test automation across various platforms will learn relevant knowledge. They will also get a deeper grasp of test automation strategies and considerations. It can also act as a supplement for quality engineering interviews.
  • Manual testers: Manual testers who wish to switch over to test automation engineering roles can use this book as the foundation and guide for their journey.
  • Software engineers: Software engineers who would like to get quickly up and running with a test automation framework can use this book as a guide. It will not only help familiarize with a framework but also review the additional considerations needed when adopting it.

What this book covers

Chapter 1, Introduction to Test Automation, introduces readers to the world of testing and test automation as a software engineering practice. It also provides insights into the roles in quality engineering and familiarizes readers with common terms and definitions.

Chapter 2, Test Automation Strategy, discusses test automation strategies and guides readers on how to devise one. It also explores the test automation pyramid and introduces readers to common test automation design patterns.

Chapter 3, Common Tools and Frameworks, establishes the basic tools that are used in test automation. It also explores in detail some of the commonly used test automation frameworks and helps you choose the right framework.

Chapter 4, Getting Started with the Basics, covers some advanced Git commands and introduces readers to IDEs. Readers are then taken through a crash course on JavaScript.

Chapter 5, Test Automation for Web, explores the tool Cypress in detail. It covers the unique aspects of Cypress and goes over the necessary steps of installation and setup. It also helps readers to write a basic test and employ assertions in it. It explains how to intercept API calls and reviews additional considerations for web test automation.

Chapter 6, Test Automation for Mobile, introduces readers to the mobile test automation framework Appium. It goes over the installation and setup and enables readers to write their first mobile automation test using Appium. It also deals with some key considerations of mobile test automation.

Chapter 7, Test Automation for API, explores in detail how to use the Postman tool to perform RESTful API testing. It also provides readers with options to automate API tests in Postman.

Chapter 8, Test Automation for Performance, introduces readers to the JMeter tool and explains how to create and execute performance tests using it. It explores the various useful aspects of JMeter for building a complete performance test. It also reviews certain key considerations when designing performance tests.

Chapter 9, CI/CD and Test Automation, establishes the concepts of CI/CD and deals with how test automation strategies apply to the CI/CD methodology. It also takes readers through a demo of GitHub Actions, which is a built-in CI/CD tool in GitHub.

Chapter 10, Common Issues and Pitfalls, educates readers on some of the common issues faced in test automation and recommends a solution for each of them. It also provides tips on avoiding any pitfalls when implementing test automation projects.

Appendix A, How to Dockerize Automated Tests, helps readers to use container technology to build and run automated tests.

To get the most out of this book

Although this book aims to build fundamental test automation knowledge, it is good to have a basic knowledge of software testing terminology. It will also be helpful to know the basics of the software development life cycle and agile software practices.

Software/hardware covered in the book

Operating system requirements

Visual Studio Code (VC Code)

Windows, macOS, or Linux

Python 3.5+

Chrome, Firefox, Edge

Java Runtime Environment (JRE) 1.8+

Terminal (macOS ) / PowerShell (Windows)

Cypress version 11.2.0

Node.js

Java Development Kit (JDK)

Android Studio

Postman (version 9.3.15)

Newman command-line tool

JDK 8 and JRE 8 or higher

Conventions used

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

Code in text: Indicates code in action, commands, keywords, folder names, filenames, file extensions, and pathnames.

Here is an example: “The setTimeout() function calls a method after a specified wait in milliseconds. For example, setTimeout(() => console.log('hello!'), 5000) prints the message after a wait of 5 seconds.”

A block of code is set as follows:

describe ("First Android Spec", () => {
it ("to find element by accessibility id", async () => {
const animationOption = await $("~Animation");

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

appium driver install xcuitest

appium driver install uiautomator2

Bold: Indicates a new term, an important word, or words that you see onscreen. Here is an example: “Use the Settings option in the Preferences menu for additional configuration.”

Tips or important notes

Appear like this.

Download the example code files

You can download the example code files for this book from GitHub at https://packt.link/Uhjqi. If there is an update to the code, it will be updated in the 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!

Get in touch

Feedback from our readers is always welcome.

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

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.packtpub.com/support/errata and fill in the form.

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.

Share Your Thoughts

Once you’ve read Test Automation Engineering Handbook, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781804615492

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.114.198