Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Selenium

You're reading from   Learn Selenium Build data-driven test frameworks for mobile and web applications with Selenium Web Driver 3

Arrow left icon
Product type Course
Published in Jul 2019
Publisher Packt
ISBN-13 9781838983048
Length 536 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Carl Cocchiaro Carl Cocchiaro
Author Profile Icon Carl Cocchiaro
Carl Cocchiaro
UNMESH GUNDECHA UNMESH GUNDECHA
Author Profile Icon UNMESH GUNDECHA
UNMESH GUNDECHA
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

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

Selenium Testing Tools

Selenium 3.0 offers three important tools, Selenium WebDriver, Selenium Server, and Selenium IDE. Each of these tools provides features to create, debug, and run tests on supported browsers and operating systems. Let's explore each of them in detail.

Selenium WebDriver 

Selenium WebDriver is the successor of Selenium RC (Remote Control), which has been officially deprecated. Selenium WebDriver accepts commands using the JSON-Wire protocol (also called Client API) and sends them to a browser launched by the specific driver class (such as ChromeDriver, FirefoxDriver, or IEDriver). This is implemented through a browser-specific browser driver. It works with the following sequence:

  1. The driver listens to the commands from Selenium 
  2. It converts these commands into the browser's native API
  3. The driver takes the result of native commands and sends the result back to Selenium:

We can use Selenium WebDriver to do the following:

  • Create robust, browser-based regression automation
  • Scale and distribute scripts across many browsers and platforms
  • Create scripts in your favourite programming language

Selenium WebDriver offers a collection of language-specific bindings (client libraries) to drive a browser. WebDriver comes with a better set of APIs that meet the expectations of most developers by being similar to object-oriented programming in its implementation. WebDriver is being actively developed over a period of time, and you can see many advanced interactions with the web as well as mobile applications.

The Selenium Client API is a language-specific Selenium library that provides a consistent Selenium API in programming languages such as Java, C#, Python, Ruby, and JavaScript. These languages bindings let tests to launch a WebDriver session and communicate with the browser or Selenium Server.

Selenium Server

Selenium Server allows us to run tests on browser instances running on remote machines and in parallel, thus spreading a load of testing across several machines. We can create a Selenium Grid, where one server runs as the Hub, managing a pool of Nodes. We can configure our tests to connect to the Hub, which then obtains a node that is free and matches the browser we need to run the tests. The hub has a list of nodes that provide access to browser instances, and lets tests use these instances similarly to a load balancer. Selenium Grid enables us to execute tests in parallel on multiple machines by managing different types of browsers, their versions, and operating system configurations centrally.

Selenium IDE

Selenium IDE is a Firefox add-on that allows users to record, edit, debug, and play back tests captured in the Selenese format, which was introduced in the Selenium Core version. It also provides us with the ability to convert these tests into the Selenium RC or Selenium WebDriver format. We can use Selenium IDE to do the following:

  • Create quick and simple scripts using record and replay, or use them in exploratory testing
  • Create scripts to aid in automation-aided exploratory testing
  • Create macros to perform repetitive tasks on Web pages

The Selenium IDE for Firefox stopped working after the Firefox 55 moved to the WebExtension format from XPI format and it is currently no longer maintained.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image