Test Automation Engineering Handbook

Book description

Understand test automation and implement it in Web, Mobile, and APIs effectively

Key Features

  • Learn how to automate your tests with the help of practical examples
  • Understand how to bridge the gap between testing and test automation
  • Explore test automation strategies for different platforms

Book Description

This book helps you build a better understanding of test automation and aids in bridging the gap between testing and test automation.

The book has been divided into three sections with the first section focusing on preparing you for testing and test automation fundamentals. By the end of this section, you'll have an understanding of some common automation terms, definitions, and roles. The second section covers the practical implementation of test automation for mobile, web, API and performance. The third section will help you understand how test automation works with CI/CD, and explore the common issues and pitfalls when executing test automation.

By the end of this book, you'll have a better understanding of automation, addressing the common pain points and best practices around test automation.

What you will learn

  • Gain a solid understanding of test automation
  • Understand how automation fits into a test strategy
  • Explore essential design patterns for test automation
  • Design and implement highly reliable automated tests
  • Understand issues and pitfalls when executing test automation
  • Discover the commonly used test automation tools/frameworks

Who this book is for

This book is for manual testers who want to enter the field of test automation and developers who want to learn more about test automation.

Table of contents

  1. Test Automation Engineering Handbook
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Conventions used
    5. Download the example code files
    6. Get in touch
    7. Share Your Thoughts
    8. Download a free PDF copy of this book
  6. Part 1: The Basics
  7. Chapter 1: Introduction to Test Automation
    1. Getting familiar with software testing
      1. Knowing the importance of testing
      2. Tasks involved in testing
      3. Testing in an world
      4. Defect management in testing
      5. Shift-Right and Shift-Left propositions
      6. Quality and DevOps
      7. Challenges in testing
      8. Test early, test often
    2. Understanding test automation
      1. Agile test automation
      2. Test automation challenges
      3. Finding and handling regression bugs
      4. Test automation metrics
    3. Exploring the roles in quality engineering
      1. Test automation engineer
      2. SDET
    4. Familiarizing yourself with common terminologies and definitions
    5. Summary
    6. Questions
  8. Chapter 2: Test Automation Strategy
    1. Technical requirements
    2. Knowing your test automation strategy
      1. Test automation objectives
      2. Gathering management support
      3. Defining the scope of test automation
      4. Test automation environment
      5. Implementing an Agile test automation strategy
      6. Reporting the test results
    3. Devising a good test automation strategy
      1. Selecting the right tools and training
      2. Standards of the test automation framework
      3. Testing in the cloud
    4. Understanding the test pyramid
      1. Unit/component tests
      2. Integration/API tests
      3. E2E/System/UI tests
      4. Structuring the test cycles
    5. Familiarizing ourselves with common design patterns
      1. Using design patterns in test automation
    6. Summary
    7. Questions
  9. Chapter 3: Common Tools and Frameworks
    1. Technical requirements
    2. The basic tools for every automation engineer
      1. The CLI
      2. Git
    3. Common test automation frameworks
      1. Selenium
      2. Appium
      3. Cypress
      4. JMeter
      5. AXE
    4. Choosing the right tool/framework
      1. Selecting a performance testing tool
      2. Selecting an API testing tool
      3. Selecting a web testing tool
      4. Mobile
      5. Common considerations
    5. Summary
    6. Questions
  10. Part 2: Practical Affairs
  11. Chapter 4: Getting Started with the Basics
    1. Technical requirements
    2. Getting more familiar with Git
      1. Committing a change
      2. Resolving merge conflicts
      3. Additional Git commands
    3. Using an IDE
      1. Choosing an IDE
      2. Downloading and setting up VS Code
    4. Introduction to JavaScript
      1. Why learn JavaScript?
      2. Running a JavaScript program
      3. JavaScript basics
    5. Summary
    6. Questions
  12. Chapter 5: Test Automation for Web
    1. Technical requirements
    2. Why Cypress?
    3. Installing and setting up Cypress
    4. Creating your first test in Cypress
      1. Creating arrow functions in JavaScript
      2. Creating callback functions in JavaScript
      3. Writing our first spec
      4. Becoming familiar with the spec structure
      5. Executing our first spec
    5. Employing selectors and assertions
      1. Working with selectors
      2. Asserting on selectors
    6. Intercepting API calls
    7. Additional configurations
    8. Considerations for web automation
      1. Limitations of Cypress
      2. Web automation considerations
    9. Summary
    10. Questions
  13. Chapter 6: Test Automation for Mobile
    1. Technical requirements
    2. Getting to know Appium
      1. What is Appium?
      2. Advantages of using Appium
    3. Knowing WebdriverIO and its advantages
    4. Setting up Appium and WebdriverIO
      1. Appium installation
      2. Configuring an Android emulator
      3. Configuring WebdriverIO with Appium
      4. WebdriverIO Android configuration
      5. Appium Inspector installation and configuration
    5. Writing our first mobile test
      1. JavaScript functions with async/await
      2. First Appium/WebdriverIO test
    6. Key considerations for mobile automation
      1. Areas of complexity
      2. iOS-specific considerations
    7. Optimizing our mobile automation framework
    8. Summary
    9. Questions
  14. Chapter 7: Test Automation for APIs
    1. Technical requirements
    2. Getting started with Postman
      1. Basics of REST API testing
      2. Downloading the Postman application
      3. Creating and managing workspaces
    3. Sending GET and POST requests
      1. Making a GET API request
      2. Making a POST API request
      3. Organizing API requests using collections
    4. Writing automated API tests
      1. Using snippets for asserting an API response
      2. Understanding Postman variables
      3. Chaining API requests
      4. Various ways to execute tests
    5. Key considerations for API automation
      1. Effective API test automation
      2. Testing GraphQL versus REST APIs
    6. Summary
    7. Questions
  15. Chapter 8: Test Automation for Performance
    1. Technical requirements
    2. Getting started with JMeter
      1. What is JMeter and how does it work?
      2. Installing JMeter
    3. Automating a performance test
      1. Building and running our first performance test
      2. Working with assertions
      3. Working with tests via the command line
      4. Using the HTTP(S) Test Script Recorder
    4. Java essentials for JMeter
      1. A quick introduction to Java
      2. Using the JSR233 assertion
    5. Considerations for performance testing
    6. Summary
    7. Questions
  16. Part 3: Continuous Learning
  17. Chapter 9: CI/CD and Test Automation
    1. Technical requirements
    2. What is CI/CD?
      1. CI/CD process
      2. CI basics
      3. CD and deployment pipeline
    3. Test automation strategies for CI/CD
      1. Unit/component tests
      2. API tests
      3. E2E tests (API and UI)
      4. Smoke tests
      5. Addressing test failures
    4. GitHub Actions CI/CD
    5. Summary
    6. Questions
  18. Chapter 10: Common Issues and Pitfalls
    1. Recurrent issues in test automation
      1. Unrealistic expectations of automated testing
      2. Inadequate manual testing
      3. Not focusing on automating the right things
      4. A lack of understanding of the system under test
      5. Overlooking test maintenance
      6. Not choosing the right tools
      7. Under-investing in test environments
      8. Taking a siloed approach
      9. Not taking a lean approach
      10. Not having a plan for test data needs
    2. Test automation anti-patterns
      1. Coding and design anti-patterns in test automation
      2. Process-oriented anti-patterns in test automation
    3. Summary
    4. Questions
  19. Appendix A:Mocking API Calls
    1. How API mocking works
    2. Mocking API calls using Postman
    3. Considerations for API mocking
    4. Summary
  20. Assessments
    1. Chapter 1, Introduction to Test Automation
    2. Chapter 2, Test Automation Strategy
    3. Chapter 3, Common Tools and Frameworks
    4. Chapter 4, Getting Started with the Basics
    5. Chapter 5, Test Automation for Web
    6. Chapter 6, Test Automation for Mobile
    7. Chapter 7, Test Automation for APIs
    8. Chapter 8, Test Automation for Performance
    9. Chapter 9, CI/CD and Test Automation
    10. Chapter 10, Common Issues and Pitfalls
  21. Index
    1. Why subscribe?
  22. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Test Automation Engineering Handbook
  • Author(s): Manikandan Sambamurthy
  • Release date: January 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781804615492