Professional Documents
Culture Documents
Selenium Fundamentals Speed Up Your Internal Testing by Automating User Interaction With Browsers and Web Applications 1st Edition Diego Molina
Selenium Fundamentals Speed Up Your Internal Testing by Automating User Interaction With Browsers and Web Applications 1st Edition Diego Molina
https://textbookfull.com/product/selenium-essentials-get-to-
grips-with-automated-web-testing-with-the-amazing-power-of-
selenium-webdriver-first-edition-sams/
https://textbookfull.com/product/python-testing-with-selenium-
learn-to-implement-different-testing-techniques-using-the-
selenium-webdriver-sujay-raghavendra/
https://textbookfull.com/product/web-api-cookbook-level-up-your-
javascript-applications-joe-attardi/
https://textbookfull.com/product/supercritical-antisolvent-
precipitation-process-fundamentals-applications-and-perspectives-
diego-t-santos/
Selenium WebDriver Recipes in C#: Practical Testing
Solutions for Selenium WebDriver 3rd Edition Courtney
Zhan
https://textbookfull.com/product/selenium-webdriver-recipes-in-c-
practical-testing-solutions-for-selenium-webdriver-3rd-edition-
courtney-zhan/
https://textbookfull.com/product/performance-testing-with-
jmeter-3-enhance-the-performance-of-your-web-application-3rd-
edition-bayo-erinle/
https://textbookfull.com/product/getting-started-with-varnish-
cache-accelerate-your-web-applications-1st-edition-thijs-feryn/
https://textbookfull.com/product/jump-start-coffeescript-get-up-
to-speed-with-coffeescript-in-a-weekend-1st-edition-castledine-
earle/
https://textbookfull.com/product/practical-web-penetration-
testing-secure-web-applications-using-burp-suite-nmap-metasploit-
and-more-1st-edition-gus-khawaja/
Selenium Fundamentals
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, without the prior written permission of the publisher, except in the case of brief
quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express or implied.
Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages
caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the
accuracy of this information.
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over
5,000 books and videos, as well as industry leading tools to help you
plan your personal development and advance your career. For more
information, please visit our website.
Why Subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
developers and tech professionals, just like you, to help them share
their insight with the global tech community. You can make a
general application, apply for a specific hot topic that we are
recruiting an author for, or submit your own idea.
Table of Contents
Title Page
Selenium Fundamentals
Packt Upsell
Why Subscribe?
Packt.com
Contributors
Preface
Who This Book Is For
Conventions Used
Get in Touch
Reviews
1. Getting Started
Software Automation
Selenium Overview
Environment Configuration
Browser Drivers
Maven Project
Summary
2. WebDriver Functionality
Navigation
Resizing
Managing Alerts
Managing Windows
ipt
Summary
3. WebElement Functionality
t
Interacting with Radio Buttons and Radio Button Groups
pdated
Creating a Custom Wait (Waiting for an Element's Attribute Upd
ates)
Creating Custom Waits for an Element's Visibility
Creating a Custom Wait (Waiting for an Element's Visibility)
Summary
7. Writing Tests
What is a Test Framework?
Choosing a Test Framework
Creating Test Scripts and Suites
Annotations
The TestNG.xml File
Activity: Creating a TestNG Test
Validating and Viewing Results
General Recommendations
Analyzing a Test Result
Tracking Down Timing Errors
How to Deal with Potential Timing Errors
Summary
9. Using a Selenium Grid
Configuring and Connecting to a Local Grid
Launching the Grid Hub
Solutions
Chapter 1: Getting Started
Activity: Automation Brainstorming
Activity: Selenium Planning
developer tools to review the code behind a web page and how to
find and interact with elements to later write and perform tests on
them.
Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://githu
b.com/TrainingByPackt/Beginning-Selenium/tree/master/docs. In case there's an
We also have other code bundles from our rich catalog of books and
videos available at https://github.com/PacktPublishing/. Check them out!
Conventions Used
There are a number of text conventions used throughout this book.
try {
driver.get("https://trainingbypackt.github.io/
Beginning-Selenium/lesson_2/exercise02_concept_04.html");
driver.switchTo().frame("info");
Piracy: If you come across any illegal copies of our works in any
form on the Internet, we would be grateful if you would provide us
with the location address or website name. Please contact us at
copyright@packt.com with a link to the material.
By Professor Wilson.
Some years ago, there used to be pointed out, upon the streets of
Glasgow, a man whose intellect had been unsettled upon a very
strange account. When a youth, he had happened to pass a lady on a
crowded throughfare—a lady whose extreme beauty, though dimmed
by the intervention of a veil, and seen but for a moment, made an
indelible impression upon his mind. This lovely vision shot rapidly
past him, and was in an instant lost amidst the commonplace crowd
through which it moved. He was so confounded by the tumult of his
feelings, that he could not pursue, or even attempt to see it again. Yet
he never afterwards forgot it.
With a mind full of distracting thoughts, and a heart filled
alternately with gushes of pleasure and of pain, the man slowly left
the spot where he had remained for some minutes as it were
thunderstruck. He soon after, without being aware of what he
wished, or what he was doing, found himself again at the place. He
came to the very spot where he had stood when the lady passed,
mused for some time about it, went to a little distance, and then
came up as he had come when he met the exquisite subject of his
reverie—unconsciously deluding himself with the idea that this might
recall her to the spot. She came not; he felt disappointed. He tried
again; still she abstained from passing. He continued to traverse the
place till the evening, when the street became deserted. By-and-by,
he was left altogether alone. He then saw that all his fond efforts
were vain, and he left the silent, lonely street at midnight, with a soul
as desolate as that gloomy terrace.
For weeks afterwards he was never off the streets. He wandered
hither and thither throughout the town, like a forlorn ghost. In
particular, he often visited the place where he had first seen the
object of his abstracted thoughts, as if he considered that he had a
better chance of seeing her there than anywhere else. He frequented
every place of public amusement to which he could purchase
admission; and he made the tour of all the churches in the town. All
was in vain. He never again placed his eyes upon that angelic
countenance. She was ever present to his mental optics, but she
never appeared in a tangible form. Without her essential presence,
all the world beside was to him as a blank—a wilderness.
Madness invariably takes possession of the mind which broods
over much or over long upon some engrossing idea. So did it prove
with this singular lover. He grew “innocent,” as the people of this
country tenderly phrase it. His insanity, however, was little more
than mere abstraction. The course of his mind was stopped at a
particular point. After this he made no further progress in any
intellectual attainment. He acquired no new ideas. His whole soul
stood still. He was like a clock stopped at a particular hour, with
some things, too, about him, which, like the motionless indices of
that machine, pointed out the date of the interruption. As, for
instance, he ever after wore a peculiarly long-backed and high-
necked coat, as well as a neckcloth of a particular spot—being the
fashion of the year when he saw the lady. Indeed, he was a sort of
living memorial of the dress, gait, and manners of a former day. It
was evident that he clung with a degree of fondness to every thing
which bore relation to the great incident of his life. Nor could he
endure any thing that tended to cover up or screen from his
recollection that glorious yet melancholy circumstance. He had the
same feeling of veneration for that day, that circumstance, and for
himself, as he then existed, which caused the chivalrous lover of
former times to preserve upon his lips, as long as he could, the
imaginary delight which they had drawn from the touch of his
mistress’s hand.
When I last saw this unfortunate person, he was getting old, and
seemed still more deranged than formerly. Every female whom he
met on the street, especially if at all good looking, he gazed at with an
enquiring, anxious expression; and when she had passed, he usually
stood still a few moments and mused, with his eyes cast upon the
ground. It was remarkable, that he gazed most anxiously upon
women whose age and figures most nearly resembled that of his
unknown mistress at the time he had seen her, and that he did not
appear to make allowance for the years which had passed since his
eyes met that vision. This was part of his madness. Strange power of
love! Incomprehensible mechanism of the human heart!—Edinburgh
Literary Journal, 1829.
NANNY WELSH, THE MINISTER’S MAID.
By Daniel Gorrie.