Selenium WebDriver Recipes in Python The problem solving guide to Selenium WebDriver in Python 1st Edition Zhimin Zhan pdf download
Selenium WebDriver Recipes in Python The problem solving guide to Selenium WebDriver in Python 1st Edition Zhimin Zhan pdf download
https://ebookname.com/product/selenium-webdriver-recipes-in-
python-the-problem-solving-guide-to-selenium-webdriver-in-
python-1st-edition-zhimin-zhan/
https://ebookname.com/product/selenium-design-patterns-and-best-
practices-build-a-powerful-stable-and-automated-test-suite-using-
selenium-webdriver-kovalenko/
https://ebookname.com/product/problem-solving-with-algorithms-
and-data-structures-using-python-second-edition-bradley-n-miller/
https://ebookname.com/product/programming-in-python-3-a-complete-
introduction-to-the-python-language-2nd-edition-summerfield/
https://ebookname.com/product/essentials-of-online-payment-
security-and-fraud-prevention-essentials-series-1st-edition-
david-a-montague/
Recessions Prospects and Developments Prospects and
Developments 1st Edition Nerea M. Pérez
https://ebookname.com/product/recessions-prospects-and-
developments-prospects-and-developments-1st-edition-nerea-m-
perez/
https://ebookname.com/product/the-last-sorcerers-the-path-from-
alchemy-to-the-periodic-table-1st-edition-morris-richard/
https://ebookname.com/product/essentials-of-stem-cell-
biology-1st-edition-r-lanza/
https://ebookname.com/product/nanomedicine-and-the-
cardiovascular-system-1st-edition-ross-j-hunter-editor/
https://ebookname.com/product/the-new-physics-for-the-twenty-
first-century-2rev-ed-edition-gordon-fraser/
Microtexture Determination and Its Applications 2nd
Edition Valerie Randle
https://ebookname.com/product/microtexture-determination-and-its-
applications-2nd-edition-valerie-randle/
Selenium WebDriver Recipes in Python
The problem solving guide to Selenium WebDriver in
Python
Zhimin Zhan
This book is for sale at http://leanpub.com/selenium-recipes-in-python
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean
Publishing process. Lean Publishing is the act of publishing an in-progress ebook using
lightweight tools and many iterations to get reader feedback, pivot until you have the right
book and build traction once you do.
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Who should read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
How to read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Recipe test scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Send me feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Selenium language bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Install Selenium Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Cross browser testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 unittest - Python Unit Testing Framework . . . . . . . . . . . . . . . . . . . 8
1.5 Run recipe scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3. Hyperlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1 Start browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Click a link by text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
CONTENTS
4. Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1 Click a button by text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2 Click a form button by text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3 Submit a form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 Click a button by ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.5 Click a button by name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.6 Click a image button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.7 Click a button via JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.8 Assert a button present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.9 Assert a button enabled or disabled? . . . . . . . . . . . . . . . . . . . . . . . 28
6. Radio button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.1 Select a radio button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.2 Clear radio option selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.3 Assert a radio option is selected . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.4 Iterate radio buttons in a radio group . . . . . . . . . . . . . . . . . . . . . . 34
6.5 Click Nth radio button in a group . . . . . . . . . . . . . . . . . . . . . . . . 34
6.6 Click radio button by the following label . . . . . . . . . . . . . . . . . . . . 35
6.7 Customized Radio buttons - iCheck . . . . . . . . . . . . . . . . . . . . . . . 36
CONTENTS
7. CheckBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.1 Select by name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.2 Uncheck a checkbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.3 Assert a checkbox is checked (or not) . . . . . . . . . . . . . . . . . . . . . . 37
7.4 Customized Checkboxes - iCheck . . . . . . . . . . . . . . . . . . . . . . . . 38
8. Select List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.1 Select an option by text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.2 Select an option by value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.3 Select an option by index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.4 Select an option by iterating all options . . . . . . . . . . . . . . . . . . . . . 40
8.5 Select multiple options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8.6 Clear one selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8.7 Clear all selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
8.8 Assert label or value in a select list . . . . . . . . . . . . . . . . . . . . . . . . 41
8.9 Assert selected option label . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
8.10 Assert the value of a select list . . . . . . . . . . . . . . . . . . . . . . . . . . 41
8.11 Assert multiple selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10. Assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.1 Assert page title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.2 Assert Page Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.3 Assert Page Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.4 Assert Label Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.5 Assert Span text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
CONTENTS
11. Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
11.1 Testing Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
11.2 Testing IFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
11.3 Test multiple iframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Afterword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Web Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Preface
After observing many failed test automation attempts by using expensive commercial test
automation tools, I am delighted to see that the value of open-source testing frameworks has
finally been recognized. I still remember the day (a rainy day at a Gold Coast hotel in 2011)
when I found out that the Selenium WebDriver was the most wanted testing skill in terms
of the number of job ads on the Australia’s top job-seeking site.
Now Selenium WebDriver is big in the testing world. We all know software giants such
as Facebook and LinkedIn use it, immensely-comprehensive automated UI testing enables
them pushing out releases several times a day¹. However, from my observation, many
software projects, while using Selenium, are not getting much value from test automation,
and certainly nowhere near its potential. A clear sign of this is that the regression testing is
not conducted on a daily basis (if test automation is done well, it will happen naturally).
Among the factors contributing to test automation failures, a key one is that automation
testers lack sufficient knowledge in the test framework. It is quite common to see some
testers or developers get excited when they first create a few simple test cases and see them
run in a browser. However, it doesn’t take long for them to encounter some obstacles: such as
being unable to automate certain operations. If one step cannot be automated, the whole test
case does not work, which is the nature of test automation. Searching solutions online is not
always successful, and posting questions on forums and waiting can be frustrating (usually,
very few people seek professional help from test automation coaches). Not surprisingly,
many projects eventually gave up test automation or just used it for testing a handful of
scenarios.
The motivation of this book is to help motivated testers work better with Selenium. The book
contains over 190 recipes for web application tests with Selenium. If you have read one of
my other books: Practical Web Test Automation², you probably know my style: practical. I
will let the test scripts do most of the talking. These recipe test scripts are ‘live’, as I have
created the target test site and included offline test web pages. With both, you can:
Usually, a ‘recipe’ book is a reference book. Readers can go directly to the part that interests
them. For example, if you are testing a multiple select list and don’t know how, you can look
up in the Table of Contents, then go to the chapter 8. This book supports this style of reading.
If you are new to Selenium WebDriver, I recommend you to try out the recipes from the
front to back. The recipes in the first half of the book are arranged according to their levels of
complexity, I believe readers can get the pattern of testing with Selenium and gain confidence
after going through them.
Send me feedback
I would appreciate your comments, suggestions, reports on errors in the book and the recipe
test scripts. You may submit your feedback on the book’s site.
Zhimin Zhan
Brisbane, Australia
1. Introduction
Selenium is a free and open source library for automated testing web applications. Selenium
was originally created in 2004 by Jason Huggins, it merged with another test framework
WebDriver in 2011 (that’s why is named ‘selenium-webdriver’) led by Simon Stewart at
Google (update: Simon now works at FaceBook). As WebDriver is a W3C standard¹, it gains
support from all major browser vendors, as a result, Selenium WebDriver quickly become
the de facto framework for automated testing web applications.
¹https://www.w3.org/TR/webdriver/
Introduction 2
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
C#:
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
class GoogleSearch
{
static void Main()
{
IWebDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.google.com");
IWebElement query = driver.FindElement(By.Name("q"));
query.SendKeys("Hello Selenium WebDriver!");
Introduction 3
query.Submit();
Console.WriteLine(driver.Title);
}
}
JavaScript:
driver.get('http://www.google.com/ncr');
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.name('btnG')).click();
driver.wait(webdriver.until.titleIs('webdriver - Google Search'), 1000);
console.log(driver.title);
Ruby:
require "selenium-webdriver"
puts driver.title
Python:
driver = webdriver.Firefox()
driver.get("http://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys("Hello WebDriver!")
elem.submit()
print(driver.title)
Introduction 4
Accept all default options except “Add python.exe to Path” for convenience.
For Mac,
brew install python3
²https://www.python.org/downloads
Introduction 5
Now you are ready to run Selenium script. Type in the above python script (google search)
in a text editor such as NotePad and save as “google_search.py”. Run the command below
in a command window.
> py google_search.py
You will see Firefox browser starting up and performing a Google search.
Chrome
To run Selenium tests in Google Chrome, besides the Chrome browser itself, ChromeDriver
needs to be installed.
Installing ChromeDriver is easy: go to ChromeDriver site⁴.
³http://en.wikipedia.org/wiki/Usage_share_of_web_browsers
⁴https://sites.google.com/a/chromium.org/chromedriver/downloads
Introduction 6
Download the one for your target platform, unzip it and put chromedriver executable in
your PATH. To verify the installation, open a command window (terminal for Unix/Mac),
execute command chromedriver, You shall see:
Starting ChromeDriver 80.0.3987.16 (....) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent
access by malicious code.
The test script below opens a site in a new Chrome browser window and closes it one second
later.
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("http://testwisely.com/demo")
time.sleep(1) # wait 1 second
driver.quit()
For readers who can’t wait to see the test running, below is the command you need to use to
execute a test, which you can download from the book’s site (Python and selenium library
need to be installed first. See instructions towards the end of this chapter).
> python ch01_open_chrome.py
Firefox
Selenium tests requires Gecko Driver⁵ to drive Firefox. The test script below will open a web
site in a new Firefox window.
⁵https://github.com/mozilla/geckodriver/releases/
Introduction 7
Internet Explorer
Selenium requires IEDriverServer to drive IE browser. Its installation process is very similar
to ChromeDriver. IEDriverServer is available at https://www.selenium.dev/downloads⁶.
Choose the right one based on your windows version (32 or 64 bit).
When a tests starts to execute in IE, before navigating the target test site, you will see this
first:
Depending on the version of IE, configurations may be required. Please see IE and IEDri-
verServer Runtime Configuration⁷ for details.
Edge
Edge is Microsoft’s new and default web browser on Windows 10. To drive Edge with
WebDriver, you need download Microsoft WebDriver⁸. After installation, you will find the
executable (MicrosoftWebDriver.exe) under Program Files folder, add it to your PATH.
However, I couldn’t get it working after installing a new version of Microsoft WebDriver.
One workaround is to specify the driver path in test scripts specifically:
⁶https://www.selenium.dev/downloads
⁷https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration
⁸https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Introduction 8
import unittest
from selenium import webdriver
class FooBarTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver = webdriver.Chrome()
@classmethod
def tearDownClass(cls):
cls.driver.quit()
def setUp(self):
self.driver.get("http://travel.agileway.net")
def tearDown(self):
self.driver.find_element_by_link_text("Sign off").click()
def test_first_case(self):
self.assertEqual("Agile Travel", self.driver.title)
self.driver.find_element_by_name("username").send_keys("agileway")
# ...
Introduction 9
def test_second_case(self):
self.driver.find_element_by_id("register_link").click()
# ...
self.assertIn("Register", self.driver.find_element_by_tag_name("body").text)
The keywords class, setUpClass, setUp and def test_xxx define the structure of a test
script file.
• class FooBarTestCase(unittest.TestCase):
Test suite name for grouping related test cases.
• setUpClass() and tearDownClass().
Optional test statements run before and after all test cases, typically starting a new
browser window in setupClass and close it in tearDownClass.
• setUp() and tearDown().
Optional test statements run before and after each test case.
• def test_xxx(self):
Individual test cases.
• Assertions
assertEqual() and assertIn are PyUnit’s two assertion methods which are used to
perform checks. More assert methods⁹
You will find more about unittest from its home page¹⁰. However, I honestly don’t think it
is necessary. The parts used for test scripts are not much and quite intuitive. After studying
and trying out some examples, you will be quite comfortable with it.
The most convenient way to run one test case or a test suite is to do it in an IDE, such as
PyCharm.
When you have a large number of test cases, then the most effective way to run
all tests is done by a Continuous Integration process.
You can locate the recipe either by following the chapter or searching by name. There are
over 150 test cases in the recipes test project. Here is the quickest way to find the one you
want in PyCharm.
Select menu ‘Navigation’ → ‘Go to Symbol …’.
A pop up window lists all test cases in the project for your selection. The finding starts as
soon as you type.
Move mouse to a line within a test case (starting def test_xxx)(self):). Right click and
select “Run ‘Unittest test_xxx’” to run this case.
Introduction 11
The below is a screenshot of execution panel when one test case failed,
You can also run all test cases in a test script file by right clicking the file name in the project
pane and select “Run ‘Unittests in test_file.py’”.
Introduction 12
The below is a screenshot of the execution panel when all test cases in a test script file passed,
F OR more than three weeks it had been very fine on land, but at
sea it was rough and stormy, and the water was churned up and
thick. For boulter-fishing in the spring the sea must be clear.
Because of the bad weather-conditions there was much poverty in
Draeth. Between the end of September and the third week in April
some of the fishermen had earned barely three pounds. Since
Christmas the boats had not once been able to put out to sea. This
meant that all through Lent, when the fish fetches record prices,
there had not been a single catch.
The poverty of the fisher-folk pressed heavily on the
tradespeople too. When children were almost starving they could not
refuse to supply the homes with food. Certainly they entered in their
credit ledgers the amounts that were due to them from this family or
that, but they well knew that in many cases the reckoning was so
great that it would take more than a lifetime to pay it off.
As it so often happens at times like these the most deserving
found the least relief. The Prynnes, the Tregennises, the Williamses,
the Darks and others shunned debt as they would have shunned the
plague. Rather than ask for food to be supplied to them on credit
they would starve. Day by day the hoard saved up against a rainy
day grew less; for you may be prepared to meet a rainy day, but
when the rainy day lengthens into a rainy month then you feel the
pinch. For many families in Draeth this was the time of fear. The
ever-present question was: How much longer was it possible to hold
out?
Then suddenly, when things were at their worst, the weather
changed. The wind slewed round to another quarter, the turbid
waters became clear, and the fisher-folk grew light-hearted, for at
last the boats would put out to sea.
It was on the Monday of the last week in April that the fleet
made preparations for sailing. Tregennis looked upon it as a lucky
omen that on that very morning he had caught a rat on the “Light of
Home.” For some days he had known the plaguey thing was there.
Down in the cuddy-hole he had found an old coat of his bitten
through in the sleeve. Some of the nets, too, had been gnawed in
places, and he had had to be busy mending tackle. It is a grave
matter when a rat boards a lugger, for there is no knowing how
many more may follow. The four men on the “Light of Home” had
laid trap after trap, temptingly baited, but without result.
Now this morning Tregennis had at last put an end to the
plaguey varmint. As this trouble was overcome it was taken by the
men as a sign that further good luck loomed ahead.
Miss Margaret went into the kitchen before breakfast and found
Mrs. Tregennis packing the basket of food for Tregennis to take to
sea.
“It do look a lot, don’t it, Miss? There isn’t much room on the
boat, so you has to get it packed up tight as can be. They did
oughter be back on Wednesday morning, but I puts in for a bit
longer than that in case.”
“If you find your store of food running short, Tregennis,” advised
Miss Margaret, “remember that you ought to chew a great number
of times, forty-five chews to each bit of food I think it is, and then
the supplies will last all the longer.”
“My dear life, Miss; ’e do just bolt his food.”
“Can’t seem to taste it, somehow, if I do keep it in my mouth,”
Tregennis explained.
“He do eat his food too fast, Miss; I never knoo anyone eat so
fast as ’e; I be always a-tellin’ ’e.”
“Well, he must practise this morning. Are you going to give him
ham for breakfast, Mrs. Tregennis?”
“’Am?—no, miss—I’ll ’am ’en. He haven’t been to sea and
caught no fish. If he don’t work neither shall he eat. That’s in the
Bible, isn’t it, Miss?”
“Something like it,” agreed Miss Margaret.
“Yes, ’tis there, for sure. If a man will not work neither shall he
eat. It don’t say nothin’ about a woman in like case.”
“Oh, well,” interrupted Tregennis, smiling good-humouredly.
“Will not work; but I will work when there’s work to be done—the
pity is so often we can’t.”
“You’re both evading this question of chewing,” Miss Margaret
complained. “It’s all the fashion now to chew. They say that if you
follow this plan you only need half the usual amount of food. You
see it all nourishes you then; otherwise half is wasted.”
“Sakes! Tom, you remember that!” admonished Mrs. Tregennis.
“’An you too, Tommy, my man. Come here an’ listen to your Mammy.
If there’s goin’ to be any savin’ in it every bite as you puts into your
mouth you chews on forty-five times—— If so be as you can count
so far,” she added, as an afterthought.
“One—two—three—four—five—six—seven,” began Tommy, in a
dreary, sing-song voice, with incatchings of the breath.
“That’ll do,” interposed Miss Margaret, hastily. “I am quite sure,
Tommy Tregennis, that you can count up to forty-five very nicely
indeed,” and, laughing, she went upstairs.
After breakfast the ladies came down to see the boats leave the
harbour with the tide.
“’Taint no good, Miss, after all,” Mrs. Tregennis called out
gloomily as they passed the kitchen door.
“Oh, Mrs. Tregennis, why? I’m so sorry! Has the wind changed
again?”
“Oh, not the fishin’, Miss, but the chewin’,” she hastened to
explain. “Tom and Tommy was both tryin’ hard but by the time
they’d chewed less an’ twenty chews they didn’t ’ave nothin’ left.”
“We was just chewin’ on nothin’,” added Tregennis, who was
drying his face on the runnerin’ towel.
“T’ad all slippen down,” volunteered Tommy, looking up from
lacing his boots.
Miss Margaret looked at them sorrowfully. “There, you see,” she
declaimed, “it is just the universal finding. You will not allow
yourselves to be improved! You do not wish to be nourished! You will
not chew! Thus you waste half, nay, more than half, of the food you
eat.”
Then, relapsing into her normal manner, “Perhaps I’m not quite
justified in speaking,” she admitted, “for I know quite definitely I
couldn’t chew forty-five times myself, and I haven’t been as
enterprising as you, for I’ve never even tried.”
Tregennis picked up the basket of food that had led to the
discussion, and Tommy and the ladies accompanied him to the quay
where he boarded the “Light of Home.”
Sitting in the sunshine on the rocks, Tommy’s Ladies watched
the fishing boats tack across to Polderry then veer slowly round and
sail in a south-westerly direction. From Tregennis they knew that the
fleet was making for Mevagissey, where they would shoot their nets
and hope to get a good catch for baiting the boulters. In those
waters they thought that the smaller fish, pollock, pilchards (not fit,
at this time of the year, for food), herring and whiting would be
plentiful.
To those who do not know, boulter-fishing seems a fairly easy
occupation. The boats sail away with something trawling after them
on the floor of the sea, and the fish is caught!
Actually it is one of the hardest bits of work a man can do. If
the first shoot of the nets is successful the boulter is baited without
delay, and the luggers may sail away at once far beyond the
Eddystone to the fishing-grounds some fifty miles from Draeth.
Often, however, it happens that the nets are shot two, three, or even
four times before the men have fish enough to bait the hooks.
The boulter is made up of thick, weighted ropes. As each
boulter is fitted with two thousand hooks, and as these hooks are
fastened to it with cotton-line about eight or nine feet apart, it
follows that the whole boulter is from three to four miles long.
All the two thousand hooks pass four times through the hands
of the men on the lugger. First of all they must be baited, and after
this they must be shot. To the end of the boulter that is shot first
from the boat a cork buoy bearing a flag is fastened. This is called
the dan. At the middle of the boulter is a second dan. “This,” as
Tregennis had explained to the ladies, “do give a second chanst, for
when once ’tis gone overboard you can’t never even say it do belong
to ee. Anythin’ may ’appen to ’e, you can’t never tell.”
When the fish is caught on the two thousand deadly hooks
these pass for the third time through the fishermen’s hands, for now
they must be hauled. Lastly, when the lugger is back in the harbour,
they must all be cleared, not cleared of the catch only, but of all the
mutilated bits of bait. Then they are thoroughly cleaned, carefully
coiled round and put away in readiness for the next time the boats
are afloat.
Miss Margaret and Miss Dorothea were discussing the heaviness
of the work and the hard lot of the fisher-folk as they watched the
luggers sail away round the curve of the coast towards Mevagissey
and the bait.
As they spoke a cormorant dived in front of them beneath the
water.
“There!” said Miss Dorothea, indignantly. “Just as if it wasn’t
enough for these people to have steam-trawlers, and weather and
dog-fish in array against them! And now the cormorants are coming
in flocks and are eating up all the smaller fish along the coast. It’s an
arrant shame!”
It was just one o’clock. The last lugger had rounded the curve.
The ladies picked up their books and walked slowly home over the
polished rocks and along the firm wide stretch of sand that grew still
wider as the tide flowed slowly out.
CHAPTER XVI
T HE day after the fishing boats put out there was a sudden
change in the weather. Little white horses rode in the bay. On
land the wind blew in sharp, fitful gusts. The watermen said that
there must be a fall of snow inland.
Towards evening Mrs. Tregennis grew restless and uneasy. After
fastening up the house for the night she slipped back the bolt, and,
throwing on a shawl, went down to the front and looked out
anxiously over the angry sea.
When she carried in the breakfast the following morning there
were deep shadows under her tired eyes.
“You didn’t sleep properly last night, now, did you?” asked Miss
Dorothea; and Mrs. Tregennis admitted that she had been awake for
many hours.
“I didn’t only partly undress,” she explained. “I felt somehow so
restless and onsettled inside o’ me. But ’tis all right now, Miss,” and
Mrs. Tregennis smiled brightly, “for the boats they be sighted I do
hear tell, and they’ll be here about eleven o’clock.”
Soon after eleven one by one the boats sailed up the harbour.
Most of the fishing families of Draeth were represented on the quay,
for there was much anxiety to find out at once if the first catch since
Christmas had been good.
TOWARDS EVENING MRS. TREGENNIS GREW
RESTLESS AND UNEASY, AND WENT DOWN TO
THE FRONT AND LOOKED OUT ANXIOUSLY
OVER THE ANGRY SEA.
Mrs. Tregennis did not go down. She was too busy to leave
home, but she sang light-heartedly as she went about her work.
“Where’s my Daddy to?” asked Tommy, when he came home
from school.
“Not come home yet, ma handsome.”
“Boats is in,” objected Tommy.
“Yes, my man, but I s’pose your Daddy’s busy cleanin’ up. Run
an’ find ’en, ma lovely, an’ tell ’en to come in quick an’ have dinner
afore he goes to bed.”
Tommy ran off to the quay and walked alongside, trying to pick
out his Daddy’s boat.
“Hallo, Tommy,” said Uncle Sam, who was hauling up water in a
bucket over the side of the ‘Henrietta.’
“Hallo,” replied Tommy, “I be lookin’ for my Daddy; where be
the ‘Light of Home,’ Uncle Sam?”
“Dear life, I don’t know! Up there ’appen,” and Uncle Sam
jerked his thumb in the direction of the bridge.
Tommy sped on. There was Uncle Harry in his boat and Uncle
Jim in his. But no Daddy and no “Light of Home” could Tommy find.
“Uncle Jim, do tell I, where be the ‘Light of Home’?”
“Sure I don’t know, Thomas, my son. Can’t ee find she?”
Tommy shook his head.
“Try down below,” and Uncle Jim waved vaguely towards the
mouth of the harbour.
“Been there,” Tommy demurred, “an’ Uncle Sam ’e said come up
’ere, ’e did.”
Uncle Jim was removing old bait from the boulter; he stopped
and scratched his head.
Tommy’s eyes grew large and puzzled.
In a few minutes the word passed round that the “Light of
Home” was missing, and with her were Tom and Jack Tregennis,
James Prynne and Billy Dark.
Tommy walked into the kitchen with a white, strained face.
“Mammy,” he said, and again, “Mammy.” Then he swallowed hard. “I
can’t find my Daddy and the’ Light of Home’ bain’t in.”
Mrs. Tregennis was kneeling in front of the fire, making toast.
She rose and turned fiercely on her son. “I’ll about half kill ee,
Tommy Tregennis,” she said, “if you come here scarin’ with such
tales as they. I don’t want none of that sort of yarn here. I’ll knock
ee flying!”
For a moment they looked into each other’s eyes. Then Tommy
flung himself on the floor in a passion of weeping, while Mrs.
Tregennis stood staring in front of her, still holding the toasting-fork
in her hand.
Awkwardly, and as if ashamed, Uncle Sam edged into the
kitchen.
“Don’t ee take on now, Ellen,” he admonished. “’Twill sure to be
all right; it be just——”
“Of course ’twill be all right, an’ righter than right,” she
interrupted, angrily. “’Tis but that fulish child. Get up, Tommy, and
come an’ have your dinner, or you’m be late to school.”
Tommy still lay on the floor, his face buried in his arms.
“Get up, I tell ee, or I’ll shift ee, my son.”
Then, as there was still no movement: “If you don’t get up to
wanst, Tommy Tregennis, I’ll tell your fäather the minute——”
The familiar threat ended abruptly, and Mrs. Tregennis turned
away, put down the toasting-fork and filled the kettle at the sink.
All through that weary Wednesday Draeth waited for the “Light
of Home” and still she did not come. There was a heavy fall of snow
inland, the papers said, and the wind at sea grew more and more
boisterous. On Thursday morning there was snow in Draeth itself,
the roofs were white, and it settled on the fields above the cliffs.
Still there was no sign of the “Light of Home.” Glasses swept the
horizon in vain. No sail was in sight!
Dozens of people were on the front looking out seaward the
whole day long. Women wept and little children were terrified.
All this time Mrs. Tregennis never left the house, but went about
her work with tight, colourless lips, and with unseeing eyes. At
school Tommy sat still and frightened, but his Mammy said ’twas
better as he should go.
Mrs. Radford attempted tactless consolation, but Tommy’s
Ladies behaved as far as possible in a normal way. Outside they
shunned the shifting throng on the front, because they dreaded
hearing the muttered conjectures. So they sat some little distance
apart on the rocks, straining—like all the rest of Draeth—straining
out to sea.
“If I were the parson here,” said Miss Margaret, “I should open
the church and ask all those people on the front to come in. I’d just
have one strong, simple prayer and sing ‘For those in peril on the
sea.’ I shouldn’t say anything to them because I should only cry if I
did.” Miss Margaret groped for her handkerchief and wiped away the
tears that were trickling down her cheek.
In the whole wide world there seemed to be one thing only that
really mattered, and this was that the “Light of Home” should sail
over the horizon and ride with the tide up the harbour to Draeth.
The remaining hours of the Thursday dragged with incredible
slowness. It was a relief when night came and there could be no
more weary gazing seaward for a few hours at least.
When Mrs. Tregennis brought the tea in the morning there was
a new look in her eyes.
“Well?” asked the ladies, fearfully.
“They’ve sighted the boat,” she said. Then her unnatural
composure gave way; she leaned up against the wall and sobbed.
Miss Margaret jumped out of bed, rescued the tray and put her
arms around her.
“You darling,” she said. “You’ve been just so brave, it’s been
wonderful.” And she and the Brown Lady cried too, cried until they
laughed, then laughed until they cried again.
Crowds waited on the Frying Pan and on the quay to see the
“Light of Home” come in. Her bows were knocked out with the
lashing of the wind and the sea. But they had got the fish! The men
were heavy with sleep, stunned with exposure, shaking with cold.
But they had got the fish!
Bit by bit their story was told. When they had anchored on the
Tuesday afternoon they had, of course, thrown out the boulter with
the anchor. About nine o’clock that night when they wanted to sail
along a bit they found the boulter had parted from the anchor. There
was nothing for it but to make their way to the dan, cast anchor
there and wait patiently until daylight. By this time all the other
boats were sailing home. They secured the boulter all right, but they
didn’t seem to have much fish. So they thought to wait a time
longer, sailed farther southwards and anchored again.
Then the wind had come up somethin’ awful. As their lugger
was not built for a heavy open sea, they reckoned to make for
home. But they found that the strong spring tide had swept the
boulter round so that it was firmly caught as ever was on some rock
or somethin’ at the bottom o’ the sea. In workin’ another man’s gear
you’d rather risk your life than leave the boulter behind! So again
there was nothin’ for it but to wait; wait this time until the heavy tide
turned and swept their boulter back again from the obstruction on
which it had caught.
Hours they had had to wait for this, and even then they couldn’t
get off. Ill-luck seemed to dog them, for once more the boulter
parted; this time in the middle. How long they were ’eavin’ an’ pullin’
an’ gropin’ they couldn’t rightly say. For more than twenty-four hours
they had had neither food nor fire. But they had got the fish and the
owner of the boat had his boulter right enough, and that alone was
a matter of twenty poun’ an’ more.
The catch of the “Light of Home” made a record sale. There, on
the quay, the fish was all arranged in heaps—congers, ray, skate,
cod, ling, hake, even a few turbot and halibut lying royally alone.
“There was certainly ’eaps of fish,” the auctioneer remarked,
“and good fish at that.”
“’Uman creatures’ lives,” Jack Chorley was heard to quote.
The auctioneer frowned him down, blew his nose and started.
“Beautiful fish, gentlemen,” thus suavely he addressed the
buyers. “Now what offers, gentlemen, for the beautiful ’eaps of
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com