Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Selenium WebDriver 3 Practical Guide

You're reading from   Selenium WebDriver 3 Practical Guide End-to-end automation testing for web and mobile browsers with Selenium WebDriver

Arrow left icon
Product type Paperback
Published in Jul 2018
Publisher Packt
ISBN-13 9781788999762
Length 280 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Satya Avasarala Satya Avasarala
Author Profile Icon Satya Avasarala
Satya Avasarala
Pallavi Sharma Pallavi Sharma
Author Profile Icon Pallavi Sharma
Pallavi Sharma
UNMESH GUNDECHA UNMESH GUNDECHA
Author Profile Icon UNMESH GUNDECHA
UNMESH GUNDECHA
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Introducing WebDriver and WebElements FREE CHAPTER 2. Different Available WebDrivers 3. Using Java 8 Features with Selenium 4. Exploring the Features of WebDriver 5. Exploring Advanced Interactions of WebDriver 6. Understanding WebDriver Events 7. Exploring RemoteWebDriver 8. Setting up Selenium Grid 9. The PageObject Pattern 10. Mobile Testing on iOS and Android using Appium 11. Data-Driven Testing with TestNG 12. Assessments 13. 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.

You have been reading a chapter from
Selenium WebDriver 3 Practical Guide - Second Edition
Published in: Jul 2018
Publisher: Packt
ISBN-13: 9781788999762
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