▶Book Description
Selenium WebDriver is an open source automation tool implemented through a browser-specific driver, which sends commands to a browser and retrieves results. The latest version of Selenium 3 brings with it a lot of new features that change the way you use and setup Selenium WebDriver. This book covers all those features along with the source code, including a demo website that allows you to work with an HMTL5 application and other examples throughout the book.
Selenium WebDriver 3 Practical Guide will walk you through the various APIs of Selenium WebDriver, which are used in automation tests, followed by a discussion of the various WebDriver implementations available. You will learn to strategize and handle rich web UI using advanced WebDriver API along with real-time challenges faced in WebDriver and solutions to handle them. You will discover different types and domains of testing such as cross-browser testing, load testing, and mobile testing with Selenium. Finally, you will also be introduced to data-driven testing using TestNG to create your own automation framework.
By the end of this book, you will be able to select any web application and automate it the way you want.
▶What You Will Learn
⦁ Understand what Selenium 3 is and how is has been improved than its predecessor
⦁ Use different mobile and desktop browser platforms with Selenium 3
⦁ Perform advanced actions, such as drag-and-drop and action builders on web page
⦁ Learn to use Java 8 API and Selenium 3 together
⦁ Explore remote WebDriver and discover how to use it
⦁ Perform cross browser and distributed testing with Selenium Grid
⦁ Use Actions API for performing various keyboard and mouse actions
▶Key Features
⦁ Unlock the full potential of Selenium to test your web applications
⦁ Use Selenium Grid for faster, parallel running, and cross-browser testing
⦁ Test iOS and Android Apps with Appium
▶Who This Book Is For
If you are a quality assurance/testing professional, test engineer, software developer, or web application developer looking to create automated test suites for your web applications, this is the perfect guide for you! As a prerequisite, this book expects you to have a basic understanding of Java programming although any previous knowledge of WebDriver or Selenium is not needed. By the end of this book, you will have acquired a comprehensive knowledge of WebDriver, which will help you in writing your automation tests.
▶What this book covers
⦁ Chapter 1, Introducing WebDriver and WebElements, will start off with an overview of Selenium and the features. Then, we quickly jump into WebDriver by describing how it perceives a web page. We will also look at what a WebDriver's WebElement is. Then, we talk about locating WebElements on a web page and performing some basic actions on them.
⦁ Chapter 2, Working with Browser Drivers, will talk about various implementations of WebDriver, such as FirefoxDriver, IEDriver, and ChromeDriver. We will configure browser options to run tests in headless mode, mobile emulation, and use custom profiles. With WebDriver becoming a W3C specification, all major browser vendors now support WebDriver natively in the browser.
⦁ Chapter 3, Using Java 8 Features along with Selenium, will talk about prominent Java 8 features such as Streams API and Lambda expressions for processing the list of WebElements. The Stream API and Lambda expression help in applying functional programming style to create readable and fluent tests.
⦁ Chapter 4, Exploring the Features of WebDriver, will talk about some advanced features of WebDriver, such as taking screenshots of web pages, executing JavaScript, handling cookies, and handling Windows and Frames.
⦁ Chapter 5, Exploring Advanced Interaction API, will dive deeply into more advanced actions that WebDriver can perform on the WebElements of a web page, such as the dragging and dropping of elements from one frame of a page to another and right/context-clicking on WebElements. We're sure you will find this chapter interesting to read.
⦁ Chapter 6, Understanding WebDriver Events, will deal with the event-handling aspect of WebDriver. To state a few, events can be a value change on a WebElement, a browser back-navigation invocation, script execution completion, and so on. We will use these events to run accessibility and performance checks.
⦁ Chapter 7, Exploring RemoteWebDriver, will talk about using RemoteWebDriver and Selenium Standalone Server for executing tests on remote machines from your machine. You can use the RemoteWebDriver class to communicate with the Selenium Standalone Server on a remote machine to run commands on the desired browser installed on the remote machine. One of its popular use cases is browser compatibility testing.
⦁ Chapter 8, Setting up Selenium Grid, will talk about one important and interesting feature of Selenium named Selenium Grid. Using this, you can execute automated tests on a distributed computer network using Selenium Grid. We will configure a Hub and Nodes for cross-browser testing. This also enables running tests in parallel and in a distributed architecture.
⦁ Chapter 9, The PageObject Pattern, will talk about a well-known design pattern named the PageObject pattern. This is a proven pattern that will give you a better handle on your automation framework and scenarios for better maintainability.
⦁ Chapter 10, Mobile Testing on iOS and Android Using Appium, will take you through how WebDriver can be used to automate your test scripts for iOS and Android platform using Appium.
⦁ Chapter 11, Data-Driven Testing with TestNG, will talk about using the data-driven testing technique with TestNG. Using the data-driven testing approach, we can reuse a test with multiple sets of test data to gain additional coverage.