Learn Selenium
eBook - ePub

Learn Selenium

Build data-driven test frameworks for mobile and web applications with Selenium Web Driver 3

  1. 536 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learn Selenium

Build data-driven test frameworks for mobile and web applications with Selenium Web Driver 3

About this book

Learn end-to-end automation testing techniques for web and mobile browsers using Selenium WebDriver, AppiumDriver, Java, and TestNG

Key Features

  • Explore the Selenium grid architecture and build your own grid for browser and mobile devices
  • Use ExtentReports for processing results and SauceLabs for cloud-based test services
  • Unlock the full potential of Selenium to test your web applications.

Book Description

Selenium WebDriver 3.x is an open source API for testing both browser and mobile applications. With the help of this book, you can build a solid foundation and can easily perform end-to-end testing on web and mobile browsers.You'll begin by being introduced to the Selenium Page Object Model for software development. You'll architect your own framework with a scalable driver class, Java utility classes, and support for third-party tools and plugins. You'll design and build a Selenium grid from scratch to enable the framework to scale and support different browsers, mobile devices, and platforms.You'll strategize and handle a rich web UI using the advanced WebDriver API and learn techniques to handle real-time challenges in WebDriver. You'll perform different types of testing, such as cross-browser testing, load testing, and mobile testing. Finally, you will also be introduced to data-driven testing, using TestNG to create your own automation framework.By the end of this Learning Path, you'll be able to design your own automation testing framework and perform data-driven testing with Selenium WebDriver.

This Learning Path includes content from the following Packt products:

  • Selenium WebDriver 3 Practical Guide - Second Edition by Unmesh Gundecha
  • Selenium Framework Design in Data-Driven Testing by Carl Cocchiaro

What you will learn

  • Use different mobile and desktop browser platforms with Selenium 3
  • Use the Actions API for performing various keyboard and mouse actions
  • Design the Selenium Driver Class for local, remote, and third-party grid support
  • Build page object classes with the Selenium Page Object Model
  • Develop data-driven test classes using the TestNG framework
  • Encapsulate data using the JSON protocol
  • Build a Selenium Grid for RemoteWebDriver testing
  • Build and use utility classes in synchronization, file I/O, reporting and test listener classes

Who this book is for

This Learning Path is ideal for software quality assurance/testing professionals, software project managers, or software developers interested in using Selenium for testing their applications. Professionals responsible for designing and building enterprise-based testing frameworks will also find this Learning Path useful. Prior programming experience in Java are TestNG is necessary.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Working Selenium WebDriver Framework Samples

This final chapter of the book is a working sample framework containing a driver class, required utility classes, browser page object classes, a browser test class, and JSON data files. The sample files will demonstrate the standards and best practices outlined in this book using the Selenium Page Object Model and DRY approaches to data-driven testing. The sample tests can be run in the IntelliJ or Eclipse IDE and contain the following components:
  • Selenium driver and DataProvider classes
  • Selenium utility classes
  • ExtentReports classes
  • Browser page object base and subclasses
  • Browser test class and data files
  • Browser suite XML and Maven POM XML files

Introduction

This final chapter is a working set of sample classes to demonstrate some of the best practices and standards that were discussed in this book. Users should be able to take the sample classes and run them in their own IDE after setting up their Selenium development environment.
The samples were built using Chrome, Firefox, and IE11 browsers. Users should download the latest Selenium 3.x JAR files, TestNG JAR files, and the required browser driver releases to support them. The following JARs and files are required to get the sample tests running:
  • Java 1.8 SDK and JRE
  • IntelliJ IDEA 2017.3
  • Selenium 3.7.1 WebDriver JARs
  • TestNG 6.11 JARs
  • ExtentReports 3.1.0 JARs
  • ChromeDriver.exe 2.33 (Windows 32-bit; there is no current 64-bit driver)
  • Firefox GeckoDriver.exe 0.19.1 (Windows 64-bit)
  • IEDriverServer.exe 3.7.1 (Windows 32-bit; runs faster than the 64-bit driver)
  • Chrome browser 62.0
  • Firefox browser 57.0
  • Internet Explorer browser 11.0
Users must place the files in a project folder in their IDE and change the paths in the selenium.properties and Global_VARS.java files to point to the correct package and driver locations. The sample framework and tests were built and tested using IntelliJ IDE on a Windows platform, but can be run on Linux or macOS as well; they are completely platform independent.
If you create the following package structure in IntelliJ, in a project called SeleniumFrameworkDesign, and add this chapter's files to it, then none of the imports or global variables need to be changed: src/main/java/com/framework/ux/utils/chapter10. Also, create the following folders for the drivers and test output: SeleniumFrameworkDesign/drivers and SeleniumFrameworkDesign/test-output.
The sample framework files were built using this open source practice website: http://www.practiceselenium.com/. It is developed by Selenium Framework 2010–2017 Copyrights reserved.
The user will gain a working knowledge of a ...

Table of contents

  1. Title Page
  2. Copyright
  3. Contributors
  4. About Packt
  5. Preface
  6. Introducing WebDriver and WebElements
  7. Using Java 8 Features with Selenium
  8. Exploring the Features of WebDriver
  9. Exploring Advanced Interactions of WebDriver
  10. Understanding WebDriver Events
  11. Exploring RemoteWebDriver
  12. Setting up Selenium Grid
  13. Data-Driven Testing with TestNG
  14. Building a Scalable Selenium Test Driver Class for Web and Mobile Applications
  15. Selenium Framework Utility Classes
  16. Best Practices for Building Selenium Page Object Classes
  17. Defining WebDriver and AppiumDriver Page Object Elements
  18. Building a JSON Data Provider
  19. Developing Data-Driven Test Classes
  20. Encapsulating Data in Data-Driven Testing
  21. Designing a Selenium Grid
  22. Third-Party Tools and Plugins
  23. Working Selenium WebDriver Framework Samples
  24. Assessments
  25. Other Books You May Enjoy

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Learn Selenium by Unmesh Gundecha, Carl Cocchiaro in PDF and/or ePUB format, as well as other popular books in Computer Science & Quality Assurance & Testing. We have over one million books available in our catalogue for you to explore.