Selenium Framework Design in Data-Driven Testing
eBook - ePub

Selenium Framework Design in Data-Driven Testing

Carl Cocchiaro, Pinakin Ashok Chaubal

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

Selenium Framework Design in Data-Driven Testing

Carl Cocchiaro, Pinakin Ashok Chaubal

Book details
Book preview
Table of contents
Citations

About This Book

Take a deep dive into building data-driven test frameworks using Selenium WebDriverAbout This Book• A comprehensive guide to designing data-driven test frameworks using the Selenium 3 WebDriver API, AppiumDriver API, Java-Bindings, and TestNG • Learn how to use Selenium Page Object Design Patterns and D.R.Y. (Don't Repeat Yourself) Approaches to software development in automated testing• Discover the Selenium Grid Architecture and build your own grid for browser and mobile devices• Use third party tools and services like ExtentReports for results processing, reporting, and SauceLabs for cloud-based test servicesWho This Book Is ForThis book is intended for software quality assurance/testing professionals, software project managers, or software developers with prior experience in using Selenium and Java to test web-based applications.This book is geared towards the quality assurance and development professionals responsible for designing and building enterprise-based testing frameworks.The user should have a working knowledge of the Java, TestNG, and Selenium technologiesWhat You Will Learn• Design the Selenium Driver Class for local, remote, and third party grid support• Build Page Object Classes using 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• Construct Utility Classes for use in Synchronization, File I/O, Reporting and Test Listener Classes• Run the sample framework and see the benefits of a live data-driven framework in real-timeIn DetailThe Selenium WebDriver 3.x Technology is an open source API available to test both Browser and Mobile applications. It is completely platform independent in that tests built for one browser or mobile device, will also work on all other browsers and mobile devices. Selenium supports all major development languages which allow it to be tied directly into the technology used to develop the applications. This guide will provide a step-by-step approach to designing and building a data-driven test framework using Selenium WebDriver, Java, and TestNG.The book starts off by introducing users to the Selenium Page Object Design Patterns and D.R.Y Approaches to Software Development. In doing so, it covers designing and building a Selenium WebDriver framework that supports both Browser and Mobile Devices. It will lead the user through a journey of architecting their own framework with a scalable driver class, Java utility classes, JSON Data Provider, Data-Driven Test Classes, and support for third party tools and plugins.Users will learn how to design and build a Selenium Grid from scratch to allow the framework to scale and support different browsers, mobile devices, versions, and platforms, and how they can leverage third party grids in the Cloud like SauceLabs.Other topics covered include designing abstract base and sub-classes, inheritance, dual-driver support, parallel testing, testing multi-branded applications, best practices for using locators, and data encapsulation.Finally, you will be presented with a sample fully-functional framework to get them up and running with the Selenium WebDriver for browser testing.By the end of the book, you will be able to design your own automation testing framework and perform data-driven testing with Selenium WebDriver.Style and approachA comprehensive approach to designing data-driven test frameworks using the Selenium 3 WebDriver API, Java-Bindings, and TestNG Technologies

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
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 here.
Is Selenium Framework Design in Data-Driven Testing an online PDF/ePUB?
Yes, you can access Selenium Framework Design in Data-Driven Testing by Carl Cocchiaro, Pinakin Ashok Chaubal in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Java. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788471732
Edition
1

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 wor...

Table of contents