0% found this document useful (0 votes)
12 views

Download (Ebook) Python Testing with Selenium: Learn to Implement Different Testing Techniques Using the Selenium WebDriver by Sujay Raghavendra ISBN 9781484262481, 9781484262498, 1484262484, 1484262492 ebook All Chapters PDF

The document provides information about various eBooks related to Selenium and Python testing, including titles, authors, and ISBNs. It also includes links to download these eBooks in different formats. Additionally, it features a detailed table of contents for 'Python Testing with Selenium' by Sujay Raghavendra, covering topics such as Selenium introduction, installation, and web element interactions.

Uploaded by

cullyradoce6
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Download (Ebook) Python Testing with Selenium: Learn to Implement Different Testing Techniques Using the Selenium WebDriver by Sujay Raghavendra ISBN 9781484262481, 9781484262498, 1484262484, 1484262492 ebook All Chapters PDF

The document provides information about various eBooks related to Selenium and Python testing, including titles, authors, and ISBNs. It also includes links to download these eBooks in different formats. Additionally, it features a detailed table of contents for 'Python Testing with Selenium' by Sujay Raghavendra, covering topics such as Selenium introduction, installation, and web element interactions.

Uploaded by

cullyradoce6
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Python Testing with Selenium: Learn to


Implement Different Testing Techniques Using the
Selenium WebDriver by Sujay Raghavendra ISBN
9781484262481, 9781484262498, 1484262484,
1484262492
https://ebooknice.com/product/python-testing-with-selenium-
learn-to-implement-different-testing-techniques-using-the-
selenium-webdriver-22474650

OR CLICK HERE

DOWLOAD EBOOK

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Selenium WebDriver Recipes in C#: Practical Testing Solutions for Selenium
WebDriver by Courtney Zhan ISBN 9798868800238, 8868800233

https://ebooknice.com/product/selenium-webdriver-recipes-in-c-practical-testing-
solutions-for-selenium-webdriver-55667478

ebooknice.com

(Ebook) Selenium Essentials : get to grips with automated web testing with the
amazing power of Selenium WebDriver by Sams, Prashanth ISBN 9781784394332,
9781784397685, 1784394335, 1784397687

https://ebooknice.com/product/selenium-essentials-get-to-grips-with-automated-
web-testing-with-the-amazing-power-of-selenium-webdriver-6657726

ebooknice.com

(Ebook) Selenium WebDriver Recipes in Python: The problem solving guide to Selenium
WebDriver in Python by Zhimin Zhan ISBN 9781514256572, 1514256576

https://ebooknice.com/product/selenium-webdriver-recipes-in-python-the-problem-
solving-guide-to-selenium-webdriver-in-python-24667606

ebooknice.com

(Ebook) Selenium WebDriver Recipes in C#: Practical Testing Solutions for Selenium
WebDriver by Courtney Zhan, (edited by) Zhimin Zhan ISBN 9798868800221,
9798868800238, 8868800225, 8868800233, B0CJ2DBVNG, B0CKSCRP5V

https://ebooknice.com/product/selenium-webdriver-recipes-in-c-practical-testing-
solutions-for-selenium-webdriver-54554740

ebooknice.com
(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Learning Selenium Testing Tools with Python by Gundecha, Unmesh ISBN
9781783983506, 1783983507

https://ebooknice.com/product/learning-selenium-testing-tools-with-
python-55668144

ebooknice.com

(Ebook) Selenium Testing Tools Cookbook, 2nd Edition: Over 90 recipes to help you
build and run automated tests for your web applications with Selenium WebDriver by
Unmesh Gundecha ISBN 9781784392512, 1784392510

https://ebooknice.com/product/selenium-testing-tools-cookbook-2nd-edition-
over-90-recipes-to-help-you-build-and-run-automated-tests-for-your-web-
applications-with-selenium-webdriver-5474490

ebooknice.com

(Ebook) Test-Driven Development with Python. Obey the Testing Goat. Using Django,
Selenium, and JavaScript by Harry J. W. Percival ISBN 9781491958674, 9781491958704,
1491958677, 1491958707

https://ebooknice.com/product/test-driven-development-with-python-obey-the-
testing-goat-using-django-selenium-and-javascript-6712714

ebooknice.com

(Ebook) Selenium with Python - A Beginner’s Guide: Get started with Selenium using
Python as a programming language by Sharma, Pallavi R ISBN 9789389328813, 9389328810

https://ebooknice.com/product/selenium-with-python-a-beginners-guide-get-
started-with-selenium-using-python-as-a-programming-language-37465562

ebooknice.com
Python Testing
with Selenium
Learn to Implement Different
Testing Techniques Using the
Selenium WebDriver

Sujay Raghavendra
Python Testing
with Selenium
Learn to Implement Different
Testing Techniques Using the
Selenium WebDriver

Sujay Raghavendra
Python Testing with Selenium
Sujay Raghavendra
Dharwad, Karnataka, India

ISBN-13 (pbk): 978-1-4842-6248-1 ISBN-13 (electronic): 978-1-4842-6249-8


https://doi.org/10.1007/978-1-4842-6249-8

Copyright © 2021 by Sujay Raghavendra


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: James Markham
Coordinating Editor: Aditee Mirashi
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@
springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole
member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc
is a Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint, paperback,
or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-6248-1. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
To my Baba
Late Raghavendra A S
Table of Contents
About the Author�����������������������������������������������������������������������������������������������������xv

About the Technical Reviewer�������������������������������������������������������������������������������xvii


Acknowledgments��������������������������������������������������������������������������������������������������xix

Introduction������������������������������������������������������������������������������������������������������������xxi

Chapter 1: Introduction to Selenium������������������������������������������������������������������������� 1


What Is Selenium?������������������������������������������������������������������������������������������������������������������������ 1
Selenium Tools and Versions��������������������������������������������������������������������������������������������������������� 1
Selenium RC (Remote Control)������������������������������������������������������������������������������������������������ 3
Selenium IDE��������������������������������������������������������������������������������������������������������������������������� 3
Selenium Grid�������������������������������������������������������������������������������������������������������������������������� 3
Selenium WebDriver���������������������������������������������������������������������������������������������������������������� 4
Selenium 2.0��������������������������������������������������������������������������������������������������������������������������� 4
Selenium 3.0��������������������������������������������������������������������������������������������������������������������������� 5
Selenium WebDriver Architecture������������������������������������������������������������������������������������������������� 5
Client Library��������������������������������������������������������������������������������������������������������������������������� 5
JSON Wire Protocol����������������������������������������������������������������������������������������������������������������� 6
Web Drivers����������������������������������������������������������������������������������������������������������������������������� 6
Web Browsers������������������������������������������������������������������������������������������������������������������������� 6
Why Selenium?����������������������������������������������������������������������������������������������������������������������������� 6
Open Source���������������������������������������������������������������������������������������������������������������������������� 7
Platforms��������������������������������������������������������������������������������������������������������������������������������� 7
Language Support������������������������������������������������������������������������������������������������������������������� 7
Browser����������������������������������������������������������������������������������������������������������������������������������� 7
Reuse��������������������������������������������������������������������������������������������������������������������������������������� 7
Easy Implementation��������������������������������������������������������������������������������������������������������������� 8

v
Table of Contents

Flexible������������������������������������������������������������������������������������������������������������������������������������ 8
Hardware Resources��������������������������������������������������������������������������������������������������������������� 8
Simulation������������������������������������������������������������������������������������������������������������������������������� 8
Other Testing Tools������������������������������������������������������������������������������������������������������������������ 8
Integrating Python with Selenium����������������������������������������������������������������������������������������������� 10
Summary������������������������������������������������������������������������������������������������������������������������������������ 14

Chapter 2: Getting Started�������������������������������������������������������������������������������������� 15


Installing Python������������������������������������������������������������������������������������������������������������������������� 15
Installing Selenium��������������������������������������������������������������������������������������������������������������������� 16
Installing Drivers������������������������������������������������������������������������������������������������������������������������� 16
Browser Commands�������������������������������������������������������������������������������������������������������������������� 17
Opening a Web Browser�������������������������������������������������������������������������������������������������������������� 17
Mozilla Firefox����������������������������������������������������������������������������������������������������������������������� 18
Google Chrome���������������������������������������������������������������������������������������������������������������������� 18
Microsoft Edge���������������������������������������������������������������������������������������������������������������������� 18
Internet Explorer�������������������������������������������������������������������������������������������������������������������� 18
Closing a Browser����������������������������������������������������������������������������������������������������������������� 19
Quit Browser�������������������������������������������������������������������������������������������������������������������������� 19
Opening a Web Page�������������������������������������������������������������������������������������������������������������� 20
Setting the Browser Size������������������������������������������������������������������������������������������������������� 21
Setting the Browser Position������������������������������������������������������������������������������������������������� 22
Setting the Size Using Coordinates��������������������������������������������������������������������������������������� 23
Getting the Browser Position������������������������������������������������������������������������������������������������� 23
Getting the Window Size�������������������������������������������������������������������������������������������������������� 24
Navigation Commands���������������������������������������������������������������������������������������������������������� 24
Running a Python Test Case�������������������������������������������������������������������������������������������������������� 26
Summary������������������������������������������������������������������������������������������������������������������������������������ 26

Chapter 3: Mouse and Keyboard Actions���������������������������������������������������������������� 27


Action Chains������������������������������������������������������������������������������������������������������������������������������ 27
Mouse����������������������������������������������������������������������������������������������������������������������������������������� 28
Click��������������������������������������������������������������������������������������������������������������������������������������� 28
vi
Table of Contents

Click and Hold������������������������������������������������������������������������������������������������������������������������ 28


Context Click�������������������������������������������������������������������������������������������������������������������������� 29
Double Click��������������������������������������������������������������������������������������������������������������������������� 29
Move to an Element��������������������������������������������������������������������������������������������������������������� 30
Move Offset��������������������������������������������������������������������������������������������������������������������������� 31
Drag and Drop����������������������������������������������������������������������������������������������������������������������� 32
Drag and Drop By������������������������������������������������������������������������������������������������������������������ 34
Release���������������������������������������������������������������������������������������������������������������������������������� 35
Keyboard Actions������������������������������������������������������������������������������������������������������������������������ 35
Key Down������������������������������������������������������������������������������������������������������������������������������ 36
Key Up����������������������������������������������������������������������������������������������������������������������������������� 36
Send Keys������������������������������������������������������������������������������������������������������������������������������ 36
Send Keys to Element������������������������������������������������������������������������������������������������������������ 37
Pause������������������������������������������������������������������������������������������������������������������������������������� 37
Reset������������������������������������������������������������������������������������������������������������������������������������� 37
Summary������������������������������������������������������������������������������������������������������������������������������������ 37

Chapter 4: Web Elements���������������������������������������������������������������������������������������� 39


Elements/Web Elements������������������������������������������������������������������������������������������������������������� 39
Web Locators������������������������������������������������������������������������������������������������������������������������������ 40
Locating Elements���������������������������������������������������������������������������������������������������������������������� 40
ID Locator������������������������������������������������������������������������������������������������������������������������������ 40
Name Locator������������������������������������������������������������������������������������������������������������������������ 41
XPath Locator������������������������������������������������������������������������������������������������������������������������ 43
CSS Selectors������������������������������������������������������������������������������������������������������������������������ 56
Link Locator��������������������������������������������������������������������������������������������������������������������������� 61
Partial Link Locator��������������������������������������������������������������������������������������������������������������� 62
Tag Name������������������������������������������������������������������������������������������������������������������������������� 63
Class Name���������������������������������������������������������������������������������������������������������������������������� 64
Locating Multiple Web Elements������������������������������������������������������������������������������������������� 65

vii
Table of Contents

Locator Issues����������������������������������������������������������������������������������������������������������������������������� 66
Attribute Change�������������������������������������������������������������������������������������������������������������������� 67
No Web Element�������������������������������������������������������������������������������������������������������������������� 67
Web Element Not Visible�������������������������������������������������������������������������������������������������������� 67
Test Case Mismatch�������������������������������������������������������������������������������������������������������������� 68
iframe Web Element�������������������������������������������������������������������������������������������������������������� 68
Summary������������������������������������������������������������������������������������������������������������������������������������ 68

Chapter 5: Navigation��������������������������������������������������������������������������������������������� 69
Hyperlinks����������������������������������������������������������������������������������������������������������������������������������� 69
Testing Hyperlinks����������������������������������������������������������������������������������������������������������������������� 70
Hyperlink by ID���������������������������������������������������������������������������������������������������������������������������� 71
Hyperlink by Text������������������������������������������������������������������������������������������������������������������������� 71
Hyperlink by Partial Link������������������������������������������������������������������������������������������������������������� 71
Hyperlink by XPath���������������������������������������������������������������������������������������������������������������������� 71
Nth Hyperlink������������������������������������������������������������������������������������������������������������������������������ 71
Return All Hyperlinks������������������������������������������������������������������������������������������������������������������ 72
Check for a Valid Hyperlink��������������������������������������������������������������������������������������������������������� 72
Check for Broken Images������������������������������������������������������������������������������������������������������������ 73
Data Attributes Hyperlink������������������������������������������������������������������������������������������������������������ 74
Summary������������������������������������������������������������������������������������������������������������������������������������ 74

Chapter 6: Buttons�������������������������������������������������������������������������������������������������� 75
Default Button����������������������������������������������������������������������������������������������������������������������������� 75
Select������������������������������������������������������������������������������������������������������������������������������������ 76
Submit/Form Button�������������������������������������������������������������������������������������������������������������������� 78
Select by Visible Text������������������������������������������������������������������������������������������������������������� 79
Image as a Button����������������������������������������������������������������������������������������������������������������������� 79
Assert for Button������������������������������������������������������������������������������������������������������������������� 80
Radio Buttons������������������������������������������������������������������������������������������������������������������������������ 81
Select Radio Buttons������������������������������������������������������������������������������������������������������������� 82
Unselect/Clear Selection������������������������������������������������������������������������������������������������������� 83

viii
Table of Contents

Assert for Radio Button��������������������������������������������������������������������������������������������������������� 84


Checkbox������������������������������������������������������������������������������������������������������������������������������������ 85
Select/Check������������������������������������������������������������������������������������������������������������������������� 86
Assert If Checkbox����������������������������������������������������������������������������������������������������������������� 87
Assert Checkbox If Checked or Not��������������������������������������������������������������������������������������� 87
Clear/Unselect/Deselect Checkbox���������������������������������������������������������������������������������������� 87
Select List����������������������������������������������������������������������������������������������������������������������������������� 88
Getting All the Options����������������������������������������������������������������������������������������������������������� 90
Select������������������������������������������������������������������������������������������������������������������������������������ 90
Unselect/Clear/Deselect�������������������������������������������������������������������������������������������������������� 92
Deselect/Clear One Selected������������������������������������������������������������������������������������������������� 92
Deselect by Visible Text��������������������������������������������������������������������������������������������������������� 92
Deselect by Value������������������������������������������������������������������������������������������������������������������ 92
Deselect by Index������������������������������������������������������������������������������������������������������������������ 93
Multiple Select List��������������������������������������������������������������������������������������������������������������������� 93
Verify������������������������������������������������������������������������������������������������������������������������������������� 94
Deselect/Clear All Selected��������������������������������������������������������������������������������������������������� 95
Summary������������������������������������������������������������������������������������������������������������������������������������ 96

Chapter 7: Frames and Textboxes�������������������������������������������������������������������������� 97


Iframe������������������������������������������������������������������������������������������������������������������������������������������ 97
Switching to Iframe��������������������������������������������������������������������������������������������������������������������� 99
Switching Using ID���������������������������������������������������������������������������������������������������������������� 99
Switching Using Name���������������������������������������������������������������������������������������������������������� 99
Switching Using Index����������������������������������������������������������������������������������������������������������� 99
Switching as an Element����������������������������������������������������������������������������������������������������� 101
Switching to a Main Iframe������������������������������������������������������������������������������������������������������� 102
Default Content�������������������������������������������������������������������������������������������������������������������� 102
Parent Frame����������������������������������������������������������������������������������������������������������������������� 102
Frames with Waits�������������������������������������������������������������������������������������������������������������������� 102
Textboxes���������������������������������������������������������������������������������������������������������������������������������� 103
Single-line Textbox�������������������������������������������������������������������������������������������������������������� 103

ix
Table of Contents

Multiline Textbox������������������������������������������������������������������������������������������������������������������ 104


Inserting Values������������������������������������������������������������������������������������������������������������������� 105
Getting Values from Textbox and Textarea��������������������������������������������������������������������������� 105
Summary���������������������������������������������������������������������������������������������������������������������������������� 106

Chapter 8: Assertions������������������������������������������������������������������������������������������� 107


The Need for Assertion�������������������������������������������������������������������������������������������������������������� 107
Basic Asserts���������������������������������������������������������������������������������������������������������������������������� 108
assertTrue���������������������������������������������������������������������������������������������������������������������������� 108
assertFalse�������������������������������������������������������������������������������������������������������������������������� 108
assertIs�������������������������������������������������������������������������������������������������������������������������������� 109
assertIsNot�������������������������������������������������������������������������������������������������������������������������� 109
assertIsNone������������������������������������������������������������������������������������������������������������������������ 109
assertIsNotNone������������������������������������������������������������������������������������������������������������������ 110
assertIsInstance������������������������������������������������������������������������������������������������������������������ 110
assertNotIsInstance������������������������������������������������������������������������������������������������������������� 110
Compare Assert������������������������������������������������������������������������������������������������������������������������� 110
assertEqual�������������������������������������������������������������������������������������������������������������������������� 111
assertNotEqual�������������������������������������������������������������������������������������������������������������������� 111
assertGreater����������������������������������������������������������������������������������������������������������������������� 112
assertGreaterEqual�������������������������������������������������������������������������������������������������������������� 112
assertLess��������������������������������������������������������������������������������������������������������������������������� 112
assertLessEqual������������������������������������������������������������������������������������������������������������������ 112
Collection Assert����������������������������������������������������������������������������������������������������������������������� 113
Lists������������������������������������������������������������������������������������������������������������������������������������� 113
Tuples���������������������������������������������������������������������������������������������������������������������������������� 113
Sets������������������������������������������������������������������������������������������������������������������������������������� 114
Dictionary���������������������������������������������������������������������������������������������������������������������������� 114
assertIn�������������������������������������������������������������������������������������������������������������������������������� 115
assertNotIn�������������������������������������������������������������������������������������������������������������������������� 115
Summary���������������������������������������������������������������������������������������������������������������������������������� 116

x
Table of Contents

Chapter 9: Exceptions������������������������������������������������������������������������������������������� 117


What Is an Exception?��������������������������������������������������������������������������������������������������������������� 117
Why Use Exceptions?���������������������������������������������������������������������������������������������������������������� 117
Exceptions in Selenium������������������������������������������������������������������������������������������������������������� 118
ConnectionClosedException������������������������������������������������������������������������������������������������ 118
ElementClickInterceptedException�������������������������������������������������������������������������������������� 118
ElementNotInteractableException��������������������������������������������������������������������������������������� 118
ElementNotSelectableException������������������������������������������������������������������������������������������ 118
ElementNotVisibleException������������������������������������������������������������������������������������������������ 118
ErrorInResponseException�������������������������������������������������������������������������������������������������� 119
ErrorHandler.UnknownServerException������������������������������������������������������������������������������ 119
ImeActivationFailedException��������������������������������������������������������������������������������������������� 119
ImeNotAvailableException��������������������������������������������������������������������������������������������������� 119
InsecureCertificateException����������������������������������������������������������������������������������������������� 119
InvalidArgumentException��������������������������������������������������������������������������������������������������� 120
InvalidCookieDomainException������������������������������������������������������������������������������������������� 120
InvalidCoordinateException������������������������������������������������������������������������������������������������� 120
InvalidElementStateException��������������������������������������������������������������������������������������������� 120
InvalidSelectorException����������������������������������������������������������������������������������������������������� 120
InvalidSessionIdException��������������������������������������������������������������������������������������������������� 120
InvalidSwitchToTargetException������������������������������������������������������������������������������������������ 121
JavascriptException������������������������������������������������������������������������������������������������������������ 121
JsonException��������������������������������������������������������������������������������������������������������������������� 121
MoveTargetOutOfBoundsException������������������������������������������������������������������������������������� 121
NoAlertPresentException����������������������������������������������������������������������������������������������������� 121
NoSuchAttributeException��������������������������������������������������������������������������������������������������� 121
NoSuchCookieException������������������������������������������������������������������������������������������������������ 122
NoSuchElementException��������������������������������������������������������������������������������������������������� 122
NoSuchFrameException������������������������������������������������������������������������������������������������������ 122
NoSuchWindowException���������������������������������������������������������������������������������������������������� 122
NoSuchContextException���������������������������������������������������������������������������������������������������� 123

xi
Table of Contents

ScreenshotException����������������������������������������������������������������������������������������������������������� 123
StaleElementReferenceException��������������������������������������������������������������������������������������� 123
TimeoutException���������������������������������������������������������������������������������������������������������������� 123
UnableToSetCookieException���������������������������������������������������������������������������������������������� 123
UnexpectedAlertPresentException�������������������������������������������������������������������������������������� 123
UnexpectedTagNameException������������������������������������������������������������������������������������������� 124
UnknownMethodException�������������������������������������������������������������������������������������������������� 124
WebDriverException������������������������������������������������������������������������������������������������������������ 124
Exception Handling������������������������������������������������������������������������������������������������������������������� 124
Timeout Exception��������������������������������������������������������������������������������������������������������������� 125
Element Not Found�������������������������������������������������������������������������������������������������������������� 125
Stale Element���������������������������������������������������������������������������������������������������������������������� 126
Summary���������������������������������������������������������������������������������������������������������������������������������� 127

Chapter 10: Waits������������������������������������������������������������������������������������������������� 129


Why the Need for Waits?����������������������������������������������������������������������������������������������������������� 130
Types of Waits��������������������������������������������������������������������������������������������������������������������������� 130
Implicit��������������������������������������������������������������������������������������������������������������������������������� 131
Explicit��������������������������������������������������������������������������������������������������������������������������������� 132
Commonly Used ExpectedConditions in the Python Class�������������������������������������������������������� 134
Differences Between Implicit and Explicit�������������������������������������������������������������������������������� 139
Fluent���������������������������������������������������������������������������������������������������������������������������������� 140
Summary���������������������������������������������������������������������������������������������������������������������������������� 142

Chapter 11: Page Objects������������������������������������������������������������������������������������� 143


Page Objects Overview������������������������������������������������������������������������������������������������������������� 143
Page Object Model (POM) Overview������������������������������������������������������������������������������������������ 144
The Need for the Page Objects Model��������������������������������������������������������������������������������������� 144
Creating Page Objects��������������������������������������������������������������������������������������������������������������� 145
Test.py��������������������������������������������������������������������������������������������������������������������������������� 145
Page.py�������������������������������������������������������������������������������������������������������������������������������� 146

xii
Table of Contents

Elements.py������������������������������������������������������������������������������������������������������������������������� 147
Locators.py�������������������������������������������������������������������������������������������������������������������������� 148
Advantages of Page Objects Model������������������������������������������������������������������������������������������ 149
Limitations of the Page Object Model��������������������������������������������������������������������������������������� 150
Summary���������������������������������������������������������������������������������������������������������������������������������� 150

Chapter 12: Using Test Cases with a Screenshot������������������������������������������������� 151


Test Outcomes�������������������������������������������������������������������������������������������������������������������������� 151
Pass/OK������������������������������������������������������������������������������������������������������������������������������� 151
Fail��������������������������������������������������������������������������������������������������������������������������������������� 152
Error������������������������������������������������������������������������������������������������������������������������������������� 152
Test Case 1: Taking a Screenshot���������������������������������������������������������������������������������������������� 152
save_screenshot (‘name_of_file’)��������������������������������������������������������������������������������������� 152
get_screenshot_as_file (‘name_of_file’)���������������������������������������������������������������������������� 153
get_screenshot_as_png( )��������������������������������������������������������������������������������������������������� 153
Testing Frameworks������������������������������������������������������������������������������������������������������������������ 154
The Unittest Framework������������������������������������������������������������������������������������������������������ 155
Test Case 2: Unittest����������������������������������������������������������������������������������������������������������������� 156
setUp( )��������������������������������������������������������������������������������������������������������������������������������� 156
tearDown( )�������������������������������������������������������������������������������������������������������������������������� 157
setUpClass��������������������������������������������������������������������������������������������������������������������������� 158
tearDownClass�������������������������������������������������������������������������������������������������������������������� 158
setUpModuleandtearDownModule�������������������������������������������������������������������������������������� 159
Test Execution Order����������������������������������������������������������������������������������������������������������������� 161
Testing Tool Comparisons��������������������������������������������������������������������������������������������������������� 162
Summary���������������������������������������������������������������������������������������������������������������������������������� 163

Index��������������������������������������������������������������������������������������������������������������������� 165

xiii
About the Author
Sujay Raghavendra works primarily in data science,
machine/deep learning, and artificial intelligence.
He is currently the Executive Director of Raghavendra
Training & Consultancy (RTC), a startup company based
in Dharwad, Karnataka, India. He co-founded RTC with
Sumedh Raghavendra, his brother, in 2014. He plans and
evaluates new technology projects in research and product
development. His projects include analyzing a pap smear
filter for microscopic medical images, thermal heat sensing
in hospitals, OCR for handwritten characters, satellite
image analysis, and network automation for maps, forecasting models, text analytics,
predictions, and more.
Raghavendra is also a consultant on building research centers for technical
universities and colleges. His recent interests include automating test cases through
machine learning. He has published numerous research articles in international journals
and has been on reviewer committees for various journals and conferences.

xv
About the Technical Reviewer
Supreeth Chandrashekhar is a seasoned software
technology professional associated with Philips Healthcare,
Bangalore. He has more than eight years of architect
experience in building/running highly robust, massively
scalable, and extremely secure systems, as well as setting
up and managing mid-sized tech teams. He is extremely
passionate about building great products that exceed
customer expectations.

xvii
Acknowledgments
The person behind who I am today is my mother, Mrs. Indumati Raghavendra.

xix
Introduction
This book focuses on how to implement testing techniques using Selenium WebDriver
with the Python programming language. This quick reference provides simple,
functional test cases with a syntax-based approach for Selenium WebDriver.
You’ll begin by reviewing the basics of Selenium WebDriver and its architectural
design history. Next, you move on to the configuration and installation of the Selenium
library in various web browsers, including the basic commands needed to start test
scripts. You’ll review keyboard and mouse action commands for testing user interactions
on a web page and see how hyperlinks are tested.
The book examines various web elements using the eight different locators provided
by Selenium to help you choose the one best suited to your needs. All Python scripts are
real ready-to-test examples that are explained thoroughly in problem statements. You’ll
use different Python design patterns to automate test scripts that can be incorporated
with Selenium.
Python Testing with Selenium teaches the expertise to write your own test cases.

xxi
CHAPTER 1

Introduction to Selenium
Before Selenium, testing the functionality of a web application was done manually,
which took many hours. The testing tended to rely on different scenarios. Each
scenario was considered a test case to enact the behavior of the web app before its
implementation. These test cases were deployed on various browsers to affirm any
issues in the source code.
It requires a dedicated team of testers to check all test cases. Accuracy and time are
major constraints in web development, which has led to automated test cases that can
be used in different web applications without changing the source code. Selenium was
developed to automate test cases.
This first chapter of the book offers a complete overview of Selenium and its core
architectural design. The subtopics explain using Selenium and compares it to other
testing tools in the domain. Later in the chapter, integrating Python with Selenium is
explained. Let’s start with a brief history and description of the Selenium tool and the
reasons to use it.

What Is Selenium?
Selenium came into existence in 2004 at ThoughtWorks to test a web application named
Time and Expenses by Jason Huggins. The tool was developed to test the front-end
behavior of an application in various browsers. The tool was popular and open source.
The increase in demand for automated testing led to the development of several versions
of Selenium over the years, which are discussed next.

Selenium Tools and Versions


ThoughtWorks has released four major versions of Selenium to test web applications.
Figure 1-1 shows each version and its release year.

1
© Sujay Raghavendra 2021
S. Raghavendra, Python Testing with Selenium, https://doi.org/10.1007/978-1-4842-6249-8_1
Chapter 1 Introduction to Selenium

6HOHQLXP
7RROV

6HOHQLXP 6HOHQLXP 6HOHQLXP 6HOHQLXP


5&  ,'(  :HE'ULYHU *ULG 

6HOHQLXP
 

6HOHQLXP
 

Figure 1-1. Selenium suite

Any one (or more) of these Selenium tools can be used by an organization; the
choice depends on the test environment’s requirements. The first tool developed by
ThoughtWorks was Selenium Core in 2004. It allowed the tester to write their own code/
script to automate front-end interactions like keyboard or mouse activities. These
activities were similar to a user interacting with the application.
In web application security, there is a policy that grants a test script permission to
access data in web pages from the same origin; this policy is called a same-host policy.
A same-host policy only allows a test case to access pages within the same domain. For
example, a test script can access multiple pages within www.apress.com, such as www.
apress.com/in/python and www.apress.com/in/about, because of the same-host
policy; however, this policy does not allow access to pages from different sites, such as
https://google.com or https://wikipedia.org.
Due to the same-host policy, access to code elements is denied or blocked when
using external scripts. To avoid this complication, Huggins and Paul Hammant
developed a server component that enables you to test a web app with a test script that
makes the browser believe that both are from the same source. This core Selenium was
eventually known as Driven Selenium or Selenium B.
2
Chapter 1 Introduction to Selenium

Selenium RC (Remote Control)


Selenium RC (remote control) was deployed by Dan Fabulich and Nelson Sproul in
2005 to enable a stand-alone server using an HTTP proxy. This solved the issue faced
by Selenium Core with the same-host policy. Selenium RC was divided into two parts:
Selenium Remote Server and Remote Client. The time it took both the server and the
client to receive and send HTTP requests led to the slower execution of test cases; hence,
Selenium RC became the least-used tool.

Selenium IDE
In 2006, a completely integrated development environment (IDE) was developed by
Shinya Kasatani for testers. It was in the form of a plugin for Mozilla Firefox and Google
Chrome web browsers. Selenium IDE used functional tests in a live environment. The
feature of this IDE involved tests to record/replay and debug/edit, which was known as
Selenium Recorder. The recording scripts were stored in a test script called a Selenese
script in Selenium. The test scripts were written in languages like Java, Ruby, JavaScript,
and PHP. The IDE also provided data retrieval options for test cases performed for web
apps. Selenium IDE is currently actively maintained by Kantu and Katalon.

Selenium Grid
It was difficult to test web applications on the new technologically-enabled devices
that were emerging on the market. To solve this issue, in 2008, Philippe Hanrigou at
ThoughtWorks developed a grid architecture that allowed you to test apps on any
number of remote devices via a browser, which became Selenium Grid. It reduced the
time to test scripts on any number of remote devices because it was done in parallel.
The test command tests on remote devices via a browser. There are two components
necessary to execute a test script on a remote device: a hub/server and a node/remote
device.
The hub/server gets requests from the web driver client that allows access and routes
it to remote drivers. These drivers are registered on remote devices. A node/remote
device has a local OS and browser. The web driver is the part of a browser that performs
tests. When defining a script, you need to name a remote device, platform, browser, and
so forth, to locate a specific node, and then test scripts are executed for that node.

3
Chapter 1 Introduction to Selenium

S
 elenium WebDriver
Selenium WebDriver is a widely used tool. The advancement in Selenium RC resulted in
the development of Selenium WebDriver. The commands in WebDriver are accepted via
a client API and are sent to different browsers, such as Mozilla Firefox, Apple Safari, and
so forth. Almost all browsers support Selenium WebDriver. Each browser has a specific
driver associated with it, which are listed in Table 1-1.

Table 1-1. Web Browsers and Their


respective Selenium WebDriver

Web Browser Driver Name

Mozilla Firefox Firefox (i.e., Gecko)


Google Chrome Chrome
Apple Safari Safari
Opera Opera
Microsoft Internet Explorer Internet Explorer
Microsoft Edge Edge

Each driver listed in the table is maintained to support automation for its respective
browser. Another browser driver, HTMLUnitDriver, stimulates browsers using a headless
browser (HtmlUnit).
Selenium WebDriver allows you to start a web browser directly and manages it by
executing commands. To avoid security conflicts and issues, WebDriver uses native OS
functionality instead of browser-based JavaScript commands. The Selenium WebDriver
version of WebDriver focused on the interface. The later versions are Selenium 2.0 and
Selenium 3.0.

S
 elenium 2.0
In 2007, Simon Stewart at ThoughtWorks created Selenium 2.0, which enables
automation on almost all browsers. This version has fewer calls and allows testers/
developers to create their own domain-specific language (DSL). The Watir web driver,
which is implemented in Ruby, is one of the best examples of DSL.

4
Chapter 1 Introduction to Selenium

S
 elenium 3.0
Developers Simon Stewart and David Burns made a draft to standardize Selenium,
which was fully accepted and became a W3C standard protocol in 2019 when it became
known as Selenium 3.0.
This completes the overview of Selenium and its evolution through the years; now
let’s consider the Selenium architecture before diving into the test cases, which are
covered in the upcoming chapters of this book.

Selenium WebDriver Architecture


Now that you know about Selenium’s various tools and versions, let’s look at a tool that
helps automate test scripts for a web application. To automate a test script, there is an
interaction between the tool and browser that can only be understood by its architecture.
Selenium WebDriver is a tool in the Selenium suite that automates test cases for
any web application. The interactions between a web driver tool and the application
go through various stages. These stages form an architecture, as depicted in Figure 1-2.
The architecture of Selenium WebDriver consists of three main components: Selenium
client libraries, browser drivers, and web browsers. The communication among the
components is done through a JSON protocol.

&OLHQW/LEUDU\ -621 :HE%URZVHU :HE%URZVHUV


ƌŝǀĞƌƐ
3URWRFRO

Figure 1-2. Selenium WebDriver architecture

C
 lient Library
A client library is a package of languages supported by Selenium. The core languages
supported by Selenium are Python, Java, JavaScript, Ruby, and C# (https://selenium.
dev/downloads/). Languages like Perl, PHP, GO, DART, R, and Haskell are maintained
and developed by a third party (https://selenium.dev/thirdparty/). Selenium does
not officially support these third-party language bindings.

5
Chapter 1 Introduction to Selenium

JSON Wire Protocol


JSON is the acronym for JavaScript Object Notation, which is a lightweight protocol that
exchanges data or information from the client to the server and vice versa. JSON is in
an easy-to-understand text format, which enabled ThoughtWorks developers to use
the JSON wire protocol for communication between the client library and web browser
drivers. The server doesn’t bother the language used at the client side; it can only read
data from the protocol, which is received in JSON format. The JSON wire protocol
converts any data or information to JSON format before sending it to the server. It is a
REST API.

Note REST (representational state transfer) defines a set of guidelines to develop


an API (application programming interface). One of the rules is to get a server
response from the source when linked to a URL.

W
 eb Drivers
Each browser has a web driver associated with it (refer to Table 1-1 for more
information). These web drivers are responsible for executing the commands received
from the client library. The execution of these commands is done in a web browser,
which communicates via HTTP.

W
 eb Browsers
The commands received from an HTTP response from web drivers are executed. Like
a client library, core and third-party browsers may be used. The browsers supported by
Selenium are Firefox, Internet Explorer, Safari, Opera, Chrome, and Edge. These browsers
can be run on any operating system, such as Windows, macOS, or Linux. There are third-
party web drivers developed for these web browsers, but they are not recommended.

W
 hy Selenium?
Having examined the Selenium WebDriver architecture, let’s further enhance your
understanding of Selenium.
6
Chapter 1 Introduction to Selenium

Due to the availability of testing tools on the market, a question arises: Why use
Selenium for testing? There are several answers to this question, but the primary reason
to use Selenium is that it is open source (i.e., freely available to use). The benefits of
using Selenium as a testing tool are discussed next.

Open Source
Selenium is open source and can be used at no cost. There is a large community of
developers/testers who continuously maintain and support it. You can modify, integrate,
or extend Selenium for any testing environment because the code is open source.

Platforms
Selenium WebDriver is cross-platform, which means that it has the flexibility to
automate test cases in any operating system, such as Windows, macOS, Unix, and Linux.
These test cases written in one OS can be used in any other.

Language Support
Another reason that Selenium has a large community is that it supports multiple
programming languages and scripts, like Python, Java, Ruby, Perl, PHP, JavaScript,
Groovy, GO, DART, and so forth. This is supported by the Selenium WebDriver language
bindings/client library.

Browser
As with platform flexibility, Selenium WebDriver supports almost all browsers. Mozilla
Firefox, Google Chrome, Safari, Opera, Internet Explorer, and Edge are supported; they
are the most widely used around the globe.

Reuse
Once written, the test scripts can be used as needed across any browser or OS. There are
no restrictions on using a test script multiple times.

7
Chapter 1 Introduction to Selenium

E asy Implementation
The implementation of Selenium WebDriver depends on the environment and the script
used by the developer/tester or organization. This variety is due to the vast number of
potential OS and browser combinations. You can develop a customized web driver or
framework to implement in a specific testing environment.

F lexible
Refactoring or regrouping in a test script enables you to reduce the amount of code
duplication and other complications. Selenium provides developers/testers with this
flexibility in a test script.

H
 ardware Resources
Unlike other testing tools—like UFT, CompleteTest, Katalon Studio, and so forth—
Selenium requires fewer hardware resources.

S
 imulation
Selenium’s simulations create the real-time behavior of a mouse and keyboard. This
helps to test advanced events like drag, drop, click, hold, scroll, and so forth, with a
mouse and similar keypress events made on a keyboard.
The various reasons discussed so far should satisfy reasons to use Selenium as a
testing tool but comparing it with the other tools available ensures that Selenium is best
at automating tests. This is discussed next.

Other Testing Tools


Now that you know the benefits offered by Selenium, let’s now compare Selenium with
other testing tools available in the testing domain. This comparison shows precise
reasons to use Selenium with Python. The comparison is made on various features of the
testing tools. There are four other major testing tools available. Table 1-2 showcases each
of these testing tools.

8
Chapter 1 Introduction to Selenium

Table 1-2. Comparing Selenium to Other Testing Tools


Selenium Katalon UFT (Unified TestComplete Watir
Studio Functional
Testing)

Release Year 2004 2015 1998 1999 2008


Test Platform Cross Cross Windows Windows Cross
Test Web apps Web/mobile Windows/web/ Windows/web/ Web/mobile
Applications apps, API/web mobile apps, mobile apps, apps
services API/web API/web services
services
Language Python, Java, C#, Java/Groovy VBScript Python, Ruby
Support Perl, JavaScript, JavaScript,
Ruby, PHP VBScript, Jscript,
Delphi, C++, C#
Installation Easy to Easy Easy Easy Advanced
Process Intermediate
(depends on the
Selenium tool)
Programming Intermediate to Advanced Advanced Advanced Advanced
Skills Advanced (for
writing desired
test cases)
Cost Free Free Licensed with Licensed with Free
maintenance maintenance fees
fees
License Type Open source Freeware Proprietary Proprietary Open
(Apache2.0) source (MIT
License)
Product Open source Community/ Dedicated Dedicated staff/ Open
Support community business staff/ community source
support community community

9
Chapter 1 Introduction to Selenium

Now that you can see that Selenium is the best-suited automated tool for testing web
applications, let’s look at why Python is the best language to integrate with Selenium.

Integrating Python with Selenium


Now that Selenium WebDriver
has been discussed, you may want to know which language is used to automate test
scripts or cases. Selenium WebDriver supports a variety of languages. The following lists
the reasons why Python is the language best suited for testing.

• Python was developed within the scope of the English language, so


code syntaxes are easy to read.

• Python scripts are not machine-level code, which makes it easy to


code.

• Python offers cross-platform support, which has resulted in a large


community of followers.

• The installation of Python on Selenium WebDriver is easier than any


other language.

• Python supports the development of web and mobile applications.


Python developers can easily migrate to Selenium WebDriver to test
their applications because Selenium is supported in Python.

• Selenium provides the Python API that connects straight to the


browser. Since Python is less verbose, the Selenium commands are
easy to write and execute when connecting to any of the supported
browsers.

• The Python programming language is a script; therefore, there is no


need for a compiler to convert code from one form to another.

• There is immense library support for Python due to the large number
of communities behind it, who maintain and update it regularly.
Selenium WebDriver can be extended to build more advanced test
cases by automating as per the needs of the organization or individual.

• Python libraries also support different language bindings. This helps


to automate test cases for applications developed in other languages.
10
Chapter 1 Introduction to Selenium

Listings 1-1 through 1-5 present a simple program for the languages that are
supported by Selenium WebDriver. The program opens a browser, visits a specified URL,
and searches a query in it. The program first imports the necessary Selenium WebDriver
libraries. WebDriver then opens the Mozilla Firefox browser and specifies www.apress.
com as the URL to visit. Next, it locates the search bar element in the Apress site. After
locating the element, this book’s title, Python Testing with Selenium, is entered as a query
in the search bar and submitted. The submitted query provides a new web page with the
books associated with the query.
Listings 1-1 through 1-5 illustrate how easy Python is to implement test cases with
Selenium web driver when compared to other programming languages, such as Java, C#,
Ruby, and PHP.

Listing 1-1. Python Code

#Importing selenium libraries in python


from selenium import webdriver

#Opening web Firefox browser using webdriver


driver=webdriver.Firefox()

#Adding URL to open in browser


driver.get("http://www.apress.com")

#Finding Element of search bar


search=driver.find_element_by_name("query")

#Searching book name as string/query in search bar


search.send_keys("Python Testing with Selenium")

#Submit string to search bar


search.submit()

# Close Firefox browser


driver.quit()

Listing 1-2. Java Code


//Importing Libraries in JAVA
importorg.openqa.selenium.By;
importorg.openqa.selenium.WebDriver;

11
Chapter 1 Introduction to Selenium

importorg.openqa.selenium.WebElement;
importorg.openqa.selenium.firefox.FirefoxDriver;

public class Search {

public static void main(String[] args) {

        //Opening Firefox Browser


        WebDriver browser = new FirefoxDriver();

        //Opening Apress Website


        browser.get("http://www.apress.com");

        //Finding Element of search bar


        WebElement search =driver.findElement(By.name("query"));

        //Searching book name as query


        search.sendKeys("Python Testing with Selenium");

        //Submitting the query


        search.submit();

        //Closing browser
        browser.close();
}
}

Listing 1-3. C# Code

//Importing Libraries in C#
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;

class Apress
{
staticvoid Main()
{
    // Opening Browser
    WebDriver browser = newFirefoxDriver();

12
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of Suomalaisia
näyttelijöitä
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Suomalaisia näyttelijöitä


Lapsuuden ja nuoruuden muistoja

Author: Aarni Kouta

Release date: February 9, 2024 [eBook #72915]

Language: Finnish

Original publication: Hämeenlinnassa: Arvi A. Karisto, 1911

Credits: Tapio Riikonen

*** START OF THE PROJECT GUTENBERG EBOOK


SUOMALAISIA NÄYTTELIJÖITÄ ***
SUOMALAISIA NÄYTTELIJÖITÄ

Lapsuuden ja nuoruuden muistoja

Kirj.

AARNI KOUTA

Hämeenlinnassa, Arvi A. Karisto Oy, 1911.


SISÄLLYS:

Esisanat.
Ida Aalberg.
Kaarola Avellan.
Emelie Stenberg.
Aurora Aspegren.
August Aspegren.
Taavi Pesonen.
Axel Ahlberg.
Adolf Lindfors.
Knut Weckman.
Katri Rautio.
Aleksis Rautio.
Iisakki Lattu.
Olga Poppius.
Kaarle Halme.

Esisana.
Ihaillessamme jotakin suurta ja jo täyden kasvuvoimansa
saavuttanutta puuta ei liene monenkaan meidän mieleemme
juohtunut ne eri kehityskaudet ja -muodot, jotka tämä puu on elänyt
ja taistellut muodostuessaan pienestä, tuskin maankamaraa
ylemmästä idusta siksi korkeaksi kasviksi, joka majaamme varjostaa.
Me näemme ihastuksella vain puun, joka työntää latvansa taivasta
kohti, ojentaa oksansa ilman tuulien tuuditeltaviksi, mutta emme
ajattele pientä tainta, joka maan uumenista kerran pyrki ja pääsi
päivän valoon, juurrutti ja levitti juurensa tahdon rantavoimalla
syvälle mullan mustaan helmaan, mistä sitten imi elämisen voiman ja
tarmon. Ja lähemmin tarkastaessamme on tässä alkutilassa ja
alkukamppailussa yhtä paljon mieltäkiinnittävää ja ihastuttavaa kuin
myöhemmässä kypsyyden kaudessakin. Vieläpä tuon taimen
kehitysilmaisuja tutkistellessamme voimme nähdä viittauksia
vastaisuuteen, edellytyksiä, edellyttäviä luonteenominaisuuksia ja
hentoja yhdyssiteitä tulevaisuuteen.

Edellinen on sovitettavissa ihmiseenkin, varsinkin voimakkaammin


ja huomattavammin kehittyneeseen ja rakentuneeseen ihmiseen,
joka on pystynyt luomaan itsestään jotakin, kyennyt kohoamaan ja
kasvamaan johonkin tehtävään, joka on jättänyt jälkiä häntä
ympäröivään elämään, vieläpä antanut parhaimmassa tapauksessa
uusia sysäyksiä kehityksen yhä etenevään ja edistyvään kulkuun. —

— Nämä muutamat rivit vain sen sarjan esisanoiksi, jossa


rupeemme kertomaan vanhempien näyttämötaiteilijaimme
lapsuuden ja nuoruuden vaiheista ja muistoista sellaisina kuin ne
haastattelujen muodossa olemme heidän omilta huuliltaan kuulleet.
Heidän taiteellisen työnsä tulokset ovat jo täysin kypsinä meidän
nähtävinämme ja arvioitavinamme; heidän varhaisimmat
sielunliikuntonsa ensimmäisistä itsetiedottomista aavisteluista
elämänuran ratkaisevaan ensi askeleeseen saakka ovat meille
tuntemattomampia, ainakin jo paljon etäisempiä asioita, joihin
kuitenkin kannattaa kerran vielä kääntää katseensa ja joiden
muistelemisesta voi koitua paljon iloa, vieläpä sangen suurta
mielenkiintoakin.

Helsingissä v. 1910.

Aarni Kouta.

Ida Aalberg.

Mainitessamme vapaaherratar Ida Aalbergille aikeestamme ja


pyytäessämme häntä kertomaan meille lapsuutensa ja nuoruutensa
vaiheista, väitti hän, että niistä ei pitkältä puhetta riittäisi. Hän muisti
olleensa tavattoman paha lapsi, ainoa tyttö kolmen veljen joukossa,
joille hänen olisi tullut olla hyvänä esimerkkinä, mutta muuttuikin joka
kohdassa aina vain varoittavaksi esimerkiksi. Hänellä oli ollut hyvin
paljon mitä pahimpia vikoja. Ensimmäinen, ja ehkä pahin, oli niistä
tietysti ollut jokin vaarallisen itsetietoinen piirre luonteessa, minkä
ilmenemismuotoja oli ollut itsepäisyys, jonkinlainen hallitsemishalu,
tahto määräysten jakelemiseen. Myöskin oli ylpeyden raskas peri- ja
helmasynti päässyt juurtumaan hänen jo niin aikaisin
turmeltuneeseen luonteeseensa. Ei ollut voinut lainkaan pitää muita
pikku tyttöjä vertaisinaan ja leikkitovereikseen kelvollisina, tuskinpa
ikäisiään ja itseään vanhempia poikiakaan, joiden kanssa oli
kuitenkin jonkunverran paremmin viihtynyt. Heissä oli sentään ollut
hiukan voimakkaampaa ainesta, mutta sitäkin vain hiukan. Hyvinkin
nuorena oli vitsaa koetettu vääntää, eikä oltu myöskään vähemmän
ahkerasti käytetty tätä samannimistä pelottavaa asetta
vääntökeinona. Mutta väännöstä ei syntynyt käännöstä —
parempaan päin. Kaukana siitä. Vuosi vuodelta nämä huonot
ominaisuudet yhä vain kasvoivat, vieläpä ilmestyi entisten lisäksi
uusiakin turman tuumia nuoreen mieleen. Kaikkein pahin niistä oli
mielikuvitus. Se oli pakottanut jättämään leikinlyönnin, unohtamaan
leikkitoverit kokonaan. Ypöyksin nuori tyttö oli kiertänyt metsiä ja
maita, koristellut itseään ruohoilla ja kukkasilla ja puhellut ääneen
itsekseen. Synkästi uskonnollisen äidin vitsa oli yhä uutterammasti
tehnyt työtään — olihan entisen itsepintaisuuden lisäksi nyt vielä
tullut paha maailmallinen mieli, mikä ilmeni päälle päätteeksi
muodossa, joka oli omiaan herättämään hämmästelyä ja naurua
muissa ihmisissä. Näin "pahaksi" lapseksi suurin
näyttämötaiteilijattaremme kuvasi itsensä, mutta lisäsi, että hän
samalla oli ollut hyvin onneton. Lapsuus oli onneton, nuoruus oli
onneton. Se oli yhtä ainoata kaipuuta, vaikka hän ei tiennyt kaipuun
syytä eikä sen päämaalia. Yhtä ainoaa kuvittelua se myöskin oli,
vaikka nämä mielikuvat eivät voineet milloinkaan kiteytyä miksikään
selviksi näyiksi ja kuvasarjoiksi. Mutta kaikesta huolimatta ne
kuitenkin elivät elämäänsä, eikä vitsa voinut niitä kuolettaa, yhtä
vähän kuin hänen omat kärsimyksensäkään.

"Mutta pahuudestani huolimatta", huomautti taiteilijatar leikillisesti,


"ovat ihmiset aina pitäneet hyvää huolta minusta, vieläpä minua
rakastaneetkin." — Täten hän esim. oli joutunut kotiseudullaan
siihen aikaan oleskelevan Minckwitzin perheen suojatiksi ja päässyt
heidän mukanaan Helsinkiin ja täällä oppilaaksi neiti Tavaststjernan
perustamaan ruotsalaiseen tyttökouluun, jonka koulun toiminta ei
kuitenkaan ollut pitkäaikainen. Kovin pitkäaikaiseksi ei taiteilijattaren
kouluopillinen ura käynyt myöskään rouva Qvistin täkäläisessä
oppilaitoksessa; keskeytymisen syynä oli tällä kertaa varojen puute,
sillä kodin piti kustantaa etupäässä veljien kalliit opinnot. Rouva
Qvistin koulussa käynnin huomattavin tapaus on mielestämme
kuitenkin se, että siellä Ida Aalberg sai ensimmäisen hänen
taiteensa osalle tulleen tunnustuksen. Kevättutkinnossa olivat
oppilaat lausuneet runoja, heidän joukossaan myöskin Ida Aalberg
"Adlercreutzin" Vänrikki Stoolin tarinoista. Tutkinnossa oli ollut läsnä
rouva von Kothen, ja oli hän, silloisen Suomen kirjallisesti ja
taiteellisesti sivistynein nainen, lausunut julkisesti ihailunsa mainitun
runon lausumisen johdosta.

Tästä johduimme kysymään sitä kappaletta ja osaa, jossa


taiteilijatar oli ensi kerran esiintynyt. Maalla, kotipuolessa se oli
tapahtunut. Joululomaansa oli sinne tullut viettämään kuopiolaisia
ylioppilaita, jotka olivat panneet toimeen pienet juhlat kansakoulun
hyväksi. Siellä oli esitetty pieni näytelmäkappale "Kassan avain",
jossa emännöitsijän osassa oli esiintynyt Ida Aalberg, silloin nuori,
tuskin nelitoistavuotias tyttönen. Hän oli jo sitä ennen paljon
uneksinut teatterista. Ensimmäisen mielenkiinnon tähän
taidelaitokseen herättivät vanhat, äidin maitokamarin seiniin
liisteröidyt ruotsinkieliset sanomalehdet, joissa oli julkaistuina
teatterien ohjelmat. Kovin oli niissä kiihottanut mielikuvitusta se, että
jonkin kuninkaan tai kuningattaren nimeä oli seurannut tavallisen
kuolevaisen nimi. Kuningattarena kuolevainen ihminen jonakin iltana!
Sellaiseksi hänkin tahtoi, niin mahdotonta kuin se olikin, sillä pitihän
jumalaa pelkäävä koti teatteria synnillisimpänä, saastaisimpana ja
turmiollisimpana laitoksena maan päällä. Kun nyt nämä ylioppilaat
tulivat esiintymispyyntöineen, oli nuoren mielikuvittelijan ilo rajaton,
mutta — sitä ei saanut näyttää. Lavalle hän kuitenkin näin
kotitanhuvilla pääsi, mutta siihen sen piti pysähtyäkin.
Niin ei kuitenkaan käynyt, onneksi suomalaisen näyttämötaiteen.
Rippikoulun käytyään, nelitoistavuotiaana, Ida Aalberg näki ensi
kerran oikean teatterin Hämeenlinnassa, jonne Suomalaisen
teatterin henkilökunta oli saapunut antamaan vierailunäytäntöjä.
Silloin hänen päätöksensä kypsyi. Tämän jälkeen häntä ei voinut
pidättää enää koti, ei rakkaus vanhempiin eikä sisaruksiin, vaan hän
karkasi heidän luotaan eräänä kevättalvisena päivänä, joutui
Helsinkiin ja pääsi Suomalaiseen teatteriin. Ensi kerran hän esiintyi
jonkun rakastavan tytön osassa näytelmäkappaleessa "Lemun
rannalla", ja sai senkin jälkeen esittää yhä edelleen pieniä
vaatimattomia tytönosia, sillä tohtori Bergbomin mielestä Ida Aalberg
oli luotu naiviksi näyttelijättäreksi. Mitään riemuvoittoja naivi
näyttelijättäremme ei voittanut, hänen ainoa ilonsa oli pyrkimys
eteenpäin, hänen ainoa murheensa se, ettei saanut oppia kyllikseen
uutta, ei tarpeeksi edistyä, päästä eteenpäin, ja ihmetteli, kuinka
toiset saattoivat olla niin levollisia, vaikka eivät olleet sen
onnellisemmassa asemassa kuin hänkään. Mutta varmasti
vakuutettu hän oli siitä, että eteenpäin hänen täytyi päästä, kaikista
vastuksista huolimatta.

Näihin aikoihin oli taiteilijattaren veli matkustanut Dresdeniin


opintojaan jatkamaan, ja kirjoitti sieltä usein sisarelleen ja kuvaili joka
kirjeessään etenkin mainitun kaupungin teatteria, joka oli hänen
mielestään maailman suurenmoisin taidelaitos. Sinne alkoi tietysti
sisarenkin halu palaa. Siellä jos missä hänkin saattoi edistyä ja oppia
jotakin uutta, ja saatuaan resetin Oulussa sekä hiukan yksityistä
avustusta, hän läksi ylpeänä matkalle kukkarossaan seitsemisen
sataa markkaa, mikä mahtava summa kestäisi tietysti vuosikausia.
Mutta pitkälle eivät sellaiset rahat riitä, niistä kun sai luovuttaa jo
opettajalleenkin 25 mk tunnista. Tästä samasta opettajasta, rouva
Seebachista tuli kuitenkin taiteilijattaren suurin turva ja opastaja tällä
hänen ensimmäisellä ja suorastaan ratkaisevalla opintomatkallaan.
Rahat loppuivat tietenkin pian, mutta into ja tarmo eivät loppuneet.
Aivan pennittömänä, perin pohjin nälkäisenä hän vain ponnisteli
edelleen, vahvasti uskoen siihen, että kaikki käy hyvin, kaikki
onnistuu vielä kerran. Nälkä tuli lopulta ilmi, mutta samalla myöskin
taiteilijattaren suuret lahjat ja uupumaton tarmo, horjumaton tahdon
lujuus. Kotimaasta toimitti rouva Seebach rahaa, joten jatkuva
oleskelu ja opiskelu ulkomailla kävi mahdolliseksi ja
hedelmöittäväksi. — Lopuksi mainittakoon vielä, että samainen
rouva Seebach oli tohtori Bergbomille kirjoittanut kirjeen ja
vakuuttanut, että tämä erehtyi toivoessaan Ida Aalbergista naivia
näyttelijätärtä, hän itse oli huomannut tässä nuoressa naisessa
piilevän syvät traagillisen näyttämötaiteilijan lahjat. Kun Ida Aalberg
palasi sitten kotimaahan, oli tohtori Bergbom antanut hänelle
koetteeksi osan Anzengruberin "Valapatosta", josta muodostui
taiteilijattaren ensimmäinen suuri voitto. "Keväällä erosin naivista
näyttelijättärestä, lokakuussa kohtasin traagillisen taiteilijattaren", oli
tohtori Bergbom esityksen jälkeen huudahtanut.

Kaarola Avellan.

Käydessämme haastattelemassa neiti Kaarola Avellania, puuttui


hän itse ensinnä puheeseen. "Haastatella ei tulisi milloinkaan itse
asianomaista henkilöä, jos mieli päästä perille hänen
luonteenomaisimmista piirteistään", lausui taiteilijatar. "Tällaisia
seikkoja olisi pikemmin tiedusteltava omaisilta ja lähimmiltä ystäviltä,
joilla on ollut tilaisuus kaiken aikaa seurata toisen kehitystä ja tehdä
huomioita sen eri ilmenemismuodoista, kuitenkin aina tarpeellisen
välimatkan päästä. Itse tulee usein vaienneeksi monesta asiasta,
jotta ei vain tekisi itserakkaan vaikutusta, usein taas tahtomattaankin
ja itsetiedottomasti hairahtuu lausumaan jonkin pienen epätotuuden,
sillä ihminen on liian lähellä omaa itseään." Myönsimme nämä
mietteet suhteellisesti sangen oikeiksikin, mutta väitimme vastaan,
että toiselta puolen vaikenemiset, toiselta pienet epätotuudet
saattoivat nekin painaa osaltaan leimansa luonnekuvaan, jonka silti
ei tarvinnut lainkaan olla väärä. Itsestään puhuessaan ihminen
kaikesta huolimatta kuvastelee vain omaa sisintä itseään, tavalla tai
toisella, ja ehkä lopultakin aina sattuvammin ja todemmin kuin
syrjäinen.

"Itsetietoinen halu antautua taiteilijauralle heräsi minussa


verrattain myöhään", alotti taiteilijatar kuvauksensa. "Monet syyt
aiheuttivat sen. Olosuhteet ja kasvatus ennen kaikkea, mutta
samassa määrin ehkä myöskin sisäänpäin vetäytyvä luonne ja
melkein voittamaton kainous." Teatteri ainakin oli se viimeinen
taidemuoto, jota neiti Avellan ajatteli, ellemme sanoisi — vihdoin
viimeinen. Koko nuoruus, silloiset olosuhteet ja ankaran
kristillismielinen kasvatus koettivat parhaansa mukaan saada häntä
loittonemaan tästä synnillisestä laitoksesta, kunnes hän viimein
kaikesta huolimatta heräsi Björnsonin "Kalastajatytön" lailla
uneksimaan naisesta, joka näyttäisi maailmalle "hvordan en Kvinde
er, naar hun er yndig, hvordan hun er, naar hun er syndig". Pitkät,
aavistuksettomat taipaleet erottavat kuitenkin lapsuuden ja
nuoruuden tästä heräämisestä, mutta itsetiedottomat sielunliikunnot
ja niiden eri ilmestysmuodot täyttävät sittenkin nämä taipaleet, ja
niitä nyt lähemmin tarkastellessamme ei suinkaan ole vaikea
huomata, että ne ovat suoranaisessa ja elimellisessä yhteydessä
taiteilijattaren myöhemmän elämänuran kanssa, ovat selviä ja
suoranaisia viittauksia siihen.
Ensimmäisenä kuvaavana ja edellyttävänä piirteenä mainitsi
taiteilijatar pukeutumishalunsa, tahdon esiintyä toisen henkilön
hahmossa. "Lapsethan yleensä tahtovat pukea ja laitella itseään",
hän sanoi, "mutta taiteilijanhan juuri täytyy olla lapsi, lapsi kehdosta
hautaan saakka, jos hänen mieli jotakin uutta ja suurta luoda." —
Ohimennen johtaa tämä ajatus mieleemme Nietzschen sanat:
"Viattomuus on lapsi ja unhoitus, uudestaan-alkaminen, leikki,
itsestään pyörivä pyörä, ensimmäinen liikunto, pyhä myöntäminen.
Niin, luomisen leikkiin, veljeni, tarvitaan pyhää myöntämistä." Siinä
ehkä kaiken suuren taiteen psykologia ja — lohdutus.

Tämä pukeutumishalu oli herännyt taiteilijattaressa jo varhain ja


herättänyt samalla mielikuvituksen rajattoman maailman eloon.
"Kalaretket isäni seurassa olivat tämän mieliteon ensimmäisenä
virikkeenä", virkkoi neiti Avellan. "Kesät vietimme aina
Ahvenanmaan saaristossa, jossa isäni ja hänen neljä tytärtään —
minä yhtenä niistä — viettivät usein vuorokausiakin kalaretkillä."
Perheessä ei ollut yhtään poikaa, senvuoksi tytöt puettiin kaikeksi
kesäksi pojanpukuun, sillä "hameet eivät saaneet alukseen astua".
Näin kului taiteilijattaren varhaisin lapsuus, kaksivuotiaasta aina
yhdenteentoista ikävuoteen saakka, kesät merellä, talvet luistin- ja
hiihtoretkillä Helsingin jäillä. Siis vapaata ja täyttä luonnonelämää,
missä mikään ei häirinnyt mielikuvitusta ja nuoren raikasta mieltä.
Mutta sitten tuli häiriö, vieläpä melkein naisluostarin muodossa.

Neiti Avellanin vanhempi sisar oli jo jonkun aikaa ollut Cecilie


Foyxellen pensioonissa Kalmarissa, ja sinne nyt lähetettiin kesken
purjehdus- ja luistinretkiä yksitoistavuotias Kaarolakin. Tässä
laitoksessa muuttui kaikki synniksi, mitä kuolevainen ihminen teki.
Kaunokirjallisuuden lukeminen oli syntiä, samoin jokainen oma
ajatus. Synnillistä oli seurustelu toisen sukupuolen kanssa, jota
syntiä kuitenkin harjoitettiin kaikessa viattomuudessa ja — pienten
vuoroserenaadien muodossa, sillä tämän "luostarin" läheisyydessä
oli maanviljelyskoulu, jonka oppilailla oli hyvä lauluääni. Kaikkein
suurin synti oli sittenkin teatteri. Neiti Avellan muisti, miten hänkin oli
ihmetellyt ja surrut ihmisten ääretöntä kevytmielisyyttä kulkiessaan
tämän taidelaitoksen ohi Kalmarissa ja kuullessaan sieltä soiton
säveliä. Muutoin oli hän taas itse puolestaan herättänyt paljon surua
ja murhetta kelpo johtajattarensa hyvässä sydämessä. Hänet oli
melkein joka päivä kutsuttu "ylös" nuhteita saamaan, "vaikka en
suinkaan ollut mikään paha lapsi, kuten vapaaherratar Ida Aalberg
on itsestään sanonut", lausui taiteilijatar. "Paha ehkä silloin, kun
minua pahalla koetettiin taivuttaa, mutta taipuvainen ja hellä kuin
vaha, silloin kun minua hyvyydellä Kohdeltiin." Tämän
äärimmäisyydestä toiseen liikahtelevan luonteenominaisuuden oli
neiti Foyxellekin huomannut, sillä eräässä kirjeessä neiti Avellanin
vanhemmille hän oli ihmetellyt tyttöstä, "jonka silmät toisena hetkenä
saattoivat säkenöidä kiivaudesta, toisena taas olla täynnä kyyneliä".
"Luonteeni onkin aina ollut äärimmäisyyksiä rakastava", lausui
taiteilijatar. "Näyttelijänä tahdoin ennen kaikkea esittää murtuvien
osia, onnetonta rakkautta j.n.e., mutta toiselta puolelta myöskin ihan
keveitä ranskalaisia salonkinäytelmiä. Ainoastaan jalojen ja
tahrattomien luonteiden esittämistä olen taiteessani aina kammonnut
ja tahtonut niitä väistää — silloisesta lapsellisuudestani huolimatta."

Mielikuvitustaan sai taiteilijatar tässä pensioonissa kuitenkin


kehittää. Pukeutumishalu sai ensinnäkin tyydytyksensä
voimistelutuntien urheilupuvuista sekä laajempi mielikuvituksen
viljeleminen niistä pienistä juhlista, joita tytöt omin päinsä saivat
panna toimeen. Niihin sommitteli Kaarola aina ohjelman. Historian
opetus ja luku aukaisi hänen mielikuviensa maailmalle uusia ja
tuntemattomia aloja. Hän tutustui mieltäkiinnittäviin
personallisuuksiin ja tapahtumiin, joissa hänen silmänsä näki aina
jotakin toimintaa ja käyntiä, ja joista hän sitten muodosteli
draamallisia kohtauksia ja sarjoja. Niitä esitettiin laitoksen puistossa,
vieläpä Kalmarin unioonin aikaisia tapauksia itse Kalmarin
historiallisessa linnassa. Parempaa näyttämöä ja ympäristöä nuori
kuvittelija ja luoja tuskin voi luomilleen toivoakaan. Tällaista elämää
kesti aina taiteilijattaren seitsemänteentoista ikävuoteen saakka,
jolloin hän palasi jälleen kotimaahan.

Täällä hän sitten ensi kerran elämässään kävi teatterissa, jotka


käynnit alkoivat yhä tiheämmin uusiintua. "Paratiisissa sitä pienillä
säästörahoilla istuttiin, sillä vanhemmat eivät siihen aikaan antaneet
lapsilleen niin runsaita käsirahoja kuin nykyään", virkkoi taiteilijatar.
— "Silloinko teissä heräsi halu antautua taiteilijauralle?" kysyimme.
— "Kaukana siitä. Näytelmätaidetta ja näyttämötaiteilijoita kyllä
rajattomasti ihailin, näin heissä suorastaan yliluonnollisen korkeita
olentoja, mikä mielikuva sitten myöhemmin kyllä perinjuurin särkyi,
mutta itse olin ihan liian nöyrä ja häveliäs moista ajattelemaankin.
Neiti Foyxelle oli myös ihan Ruotsiin saakka kuullut näistä teatterissa
käynneistäni ja sieltä hän kirjoitti asian johdosta pitkän
varoituskirjeen vanhemmilleni ja pyysi heitä palauttamaan nuorta
sielua pois synnin poluilta." — "Eihän sitäpaitsi ollut vielä olemassa
suomenkielistä näyttämöä, joka olisi ollut ainoa, mihin minä olisin
liittynyt, huolimatta siitä, että en osannut sanaakaan tätä kieltä.
Sellainen oli aika silloin", lisäsi neiti Avellan.

Oli kuitenkin juuri siihen aikaan olemassa silloinen suomalainen


ooppera, jonka lavalla Kaarola Avellan ensi kerran esiintyi, tosin vain
muiden mukana kuorossa laulamassa. Hänen sisarensa,
myöhemmin rouva Aura Thuring, kuului tämän laitoksen esiintyviin
taiteilijoihin, ja tämän osat valmisti ja opetti hänelle aina Kaarola
sisar. "Sain kuitenkin elää taiteessa, vaikkakin vain toisen henkilön
hahmossa; itse olin liian arka, tässä oli minulle jo kylliksi. Siinä ehkä
myöskin syyt luonteeni pedagoogisiin ominaisuuksiin." —

Kaarola Avellanin ollessa yksikolmattavuotias, piti Aura sisaren


lähteä Tukholmaan lauluopinnoitaan jatkamaan ja Kaarolan seurata
häntä sinne kaunolukua opiskelemaan. Kihlaus pidätti kuitenkin
sisaren kotimaahan, ja Kaarola sai lähteä yksin matkalle.
Opettajakseen hän sai rouva Betzy Almlöfin, joka sittemmin,
oppilaansa uutteruuteen ja tarmoon sekä suuriin lahjoihin
ihastuneena, tarjosi tälle paikan Tukholman kuninkaallisessa
teatterissa. "Elämäni suurin tragedia on se, etten ottanut tätä
tarjousta vastaan. Minun täytyi päästä suomenkieliselle näyttämölle,
ja oppia yht'aikaa — vieras kieli ja tekotavan suuret vaikeudet!"

Seuraavaksi kesäksi asettui Kaarola Avellan ihan yksikseen


Kangasalle, missä sanakirja kädessä, pelkkien talonpoikien joukossa
opetteli suomea. Syksyllä hän sitten liittyi Suomalaiseen Teatteriin ja
esiintyi ensi kerran Aleksis Kiven Leana Hämeenlinnassa
marraskuun 26 p:nä 1876. —

Mitään unelmia taiteilijattarellamme ei näyttelijäurasta ollut


milloinkaan ollut, sille jouduttuaan hän unelmoimatta ajatteli vain
työtään. Suurimmat taiteelliset ilonsa hän tunsi kotona osiaan
valmistellessaan ja niitä tutkistellessaan, lavalla hän ei koskaan
voinut täydellisesti antautua, ei päästää temperamenttiaan valloille;
vieraan kielen käyttö kytki kaiken rautakahleisiin. Kun neiti Avellan
sitten myöhemmin erosi teatterista, tarjosi toht. Bergbom hänelle heti
kaunoluvun opettajan toimen, "jossa toimessa sitten taas sain
vapaasti elää elämäni taiteessa, jota vailla kaikki olisikin tyhjää",
lopetti taiteilijatar haastattelun.
Emelie Stenberg.

— Mitä minun pitäisi teille nyt oikeastaan kertoa? alotti neiti


Stenberg haastattelun. Pelkäänpä melkein, että olette turhan tautta
matkustanut tänne maalle saakka kuulemaan niitä vähiä muistoja,
mitä minulla on lapsuudestani ja nuoruudestani. Syntynyt olen
Turussa, jota tapausta en muista, yhtä vähän kuin sitäkään, että jo
vuoden vanhana jouduin Poriin isoisäni ja -äitini silloin lapsettomaan
perheeseen. Syystalvella sinne vanhempani matkustivat ja jättivät
minut sitten sinne kovien pakkasten takia. Vuoden päästä kun
palasivat noutamaan, eivät minua enää saaneet, niin olivat
vanhukset pienen tyttärensä tyttären seuraan jo ehtineet kiintyä.

— Entäpä muistot tuosta uudesta lapsuuden kodista? koetimme


udella.

— Muistoja ei mitään. Olin aina vain täysikasvuisten seurassa,


jossa hyvin viihdyinkin. Varsinaiset lapsuuden muistot liittynevät
leikkitovereihin, ja sellaisina minulla oli vain kotitalon kanat ja kukot
sekä naapurin koira.

— Minkä ikäisenä sitten aloitte ensi kerran teatteria ajatella?

— En sitä milloinkaan ole ajatellut. Ensikiintymykseni tähän


laitokseen sain niistä kiertävistä seurueista, jotka silloin tällöin
antoivat näytäntöjään Porissakin, ensi kiintymykseni ja ensimmäisen
— korvapuustin. Kävelin näet isoäidin kera eräänä päivänä
kaupungilla, ja vastaamme tuli muuan nuori näyttelijä, jonka esitystä
olin juuri jonakin iltana ihaillut, 'katsokaahan, isoäiti, tuota kaunista
näyttelijää', virkoin. 'Kauniin näyttelijän' palkaksi paukahti
korvapuusti. "Vai sellaisissa mietteissä nuoret tytöt kulkevat!"
— Kuinka sitten itse jouduitte ensi kerran näyttämölle?

— Porissa esitettiin usein seuranäytelmiä. Kun minua pyydettiin


niihin avustamaan, en milloinkaan kieltäytynyt. Noin
yksikolmattavuotiaana esiinnyin siellä ensi kerran näytellen Rebekan
osaa Topeliuksen kappaleessa "Ett skärgårdsäfventyr", ellen aivan
väärin muista.

— Siitä pitäenkö ajattelitte näyttelijäuralle antautumista?

— Kuten sanottu, en ole sitä koskaan ajatellutkaan. Eihän minua


koirat ja kanat sellaiseen voineet opettaa, eikä mokomaan ollut
sitäpaitsi aikaakaan, sillä kahdeksantoistavuotiaana, jolloin
vanhempani kuolivat, sain kaikki nuoremmat sisarukset
hoidettavikseni.

— Mutta tästä kaikesta huolimatta jouduitte kuitenkin teatteriin.


Mikä sitten aiheutti tämän jyrkän käänteen elämässänne?

— Veljeni Elis Oskar Stenbergin sairastuminen. Syksyllä 1874 hän


kirjoitti minulle Helsingin klinikasta, jossa silloin makasi, ja pyysi
minua saapumaan sinne seurakseen. Minä saavuinkin, ja eräänä
kauniina päivänä Eos (= E.O.S.), kuten häntä toveripiirissä
nimitettiin, ilmoitti minulle päättäneensä toht. Bergbomin kanssa, että
minun oli liityttävä Suomalaiseen teatteriin. Suomalaiseen teatteriin
— osaamatta sanaakaan suomenkieltä, siitä nyt ei milloinkaan tule
mitään! Mutta siitä täytyi kuitenkin tulla jotakin, ja sitä mieltä olen
aina ollut, että kaikki käy, mitä ihminen vain lujasti tahtoo. — Ja
lujasti siinä täytyikin tahtoa, jatkoi taiteilijatar kertomustaan. Viisi
viimeistä elinkuukauttaan veljeni opetti minulle suomea, jonka kielen
opinnot hän itse oli alkanut sommittelemalla sanakirjojen avulla
kokoon yksinkertaisen, mutta sitten koko lyhyen elämänsä
johtotähdeksi käyneen lauseen: sinua rakastan, suloinen kieli. Ja se
lause muuttui minunkin elämäni johtotähdeksi. Kun veljeni sitten
seuraavana keväänä kuoli, matkustin yksin Hämeeseen
kieliopinnoitani jatkamaan.

— Tiesikö veljenne sitten jo edeltäpäin näyttämölliset


taipumuksenne? kysäisimme.

— Ei hän niistä mitään tiennyt. Parooni Troil oli nähnyt minun


esiintyvän seuranäytelmissä Porissa ja toi siitä mieltymyksensä
viestit Helsinkiin toht. Bergbomille ja veljelleni.

— Milloin sitten liityitte varsinaisesti teatterin palvelukseen?

— Vuoden 1875 syyskesällä, heti Hämeestä palattuani. Elokuun 5


p:nä matkustimme Ouluun ja siellä esiinnyin sitten ensi kerran
Guldborgin osassa "Sven Dyringin kodissa" nimisessä näytelmässä.

— Millaiseksi olitte uneksinut tämän uuden elämänuranne?

— Tietysti pidin sitä hyvin korkeana, mutta mitään unelmia minulla


ei siitä ollut. Olin näet jo kolmenneljättävuotias, siis iässä, jolloin
ihminen ei enää unelmoi, vaan ottaa tosiasiat sellaisina kuin ne ovat.

— Entä ensimmäiset huolenne ja murheenne?

— Ei ollut ensimmäisiä eikä viimeisiäkään, sillä siinä iässä ei


ihminen myöskään enää huolehdi eikä murehdi, hän tekee vain
työnsä. Kieli tietysti oli haittana; usein sanoinkin, että työni
teatterissa oli kuin halonhakkuuta, mutta kernaasti sitä kuitenkin tein,
sillä yleisö oli minuun, kielitaitoni vajavaisuudesta huolimatta,
tyytyväinen. Ja saikin luvan olla, sillä ei ollut ketään, joka minun
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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like