Selenium with Python - A Beginner's Guide
Get started with Selenium using Python as a programming language
Pallavi R Sharma
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Selenium with Python - A Beginner's Guide
Get started with Selenium using Python as a programming language
Pallavi R Sharma
About This Book
Step by step directions to get started with Selenium using Python as a programming language. Key Features
- Get introduced to the world of Selenium
- Understand the concept of locators in Selenium
- Learn how to write scripts using Selenium WebDriver in Python
- Learn the concepts of synchronization
- Learn how to handle different HTML elements like form, table, alert, frame, and dropdown
- Learn about design patterns like the page object model, data-driven tests, and adding assertions.
Description
Selenium is the most popular open source test automation tool available in the market. In the last decade, its usage has dramatically increased in the IT sector across all types of organizations. The reason for its popularity is mainly because it supports multiple programming languages, test executions on multiple browsers and operating systems. In this book, we will learn about the different components of Selenium. We will discuss the concepts of WebDriver and learn how to apply test automation concepts with it to automate the testing of our application. We will learn the process of recognizing the test objects on the screen and writing Selenium commands using Python as a programming languageWe will also discuss how to use design patterns like the page object mode and data-driven testing to ensure building a robust test framework, which is modular and scalable in nature. What You Will Learn
The objective is to introduce the world of Selenium to a manual tester who knows Python as a programming language. You will learn to demystify the concept of identifying test objects and writing Selenium commands to create robust test scripts. This book will help learn to automate different HTML elements, which we come across in the web applications we need to test. You will understand how to build a good test suite by learning the concept of design patterns like the page object model and data-driven tests to ensure maintainability of code. Who this book is for
This book is for people who have experience in manual testing and knowledge in Python as a programming language. This book will also be helpful for a developer who knows Python as a programming language and is looking for test automation as a career option. Table of Contents
1. Selenium - Important Conceptual Background
2. Selenium IDE
3. Locators in Selenium
4. Installation and Setup
5. Selenium WebDriver
6. Unit Test Creation n Python
7. Synchronizing Tests
8. Parameterization of Tests
9. Handling Different Web Elements
10. Working with Frames
11. Concept of the Page Object Model
12. Implementing Selenium Grid About the Author
Pallavi has an overall professional experience of 14 years. She has worked in varied roles as a product/project manager in the presales team and marketing team for solutions on test automation tools.She holds two provisional patents along with other contributors for her work on building tool agnostic test automation framework solutions. Currently, she is acting as a test automation coach, writer, speakerand owner at 5 Elements Learning where she collaborates and works with test automation enthusiasts across the globe. As an avid learner, she likes to keep herself updated to the latest trends andTechnologies. She is a firm believer in a larger good and likes to live by example.She volunteers her time for the organization eVidyaloka where she acts as a centre administrator. She is a lifetime member for the Jabarkhet forest reserve and People for Animals. Website: http://5elementslearning.com
LinkedIn Profile: https://www.linkedin.com/in/pallavirsharma/
Frequently asked questions
Information
CHAPTER 1
Introduction to Selenium
Structure
- History of Selenium
- Benefits of Selenium
- Components of Selenium
- Architecture of Selenium
Objective
History of Selenium
- Projects: This tab basically lists the four projects, which make the Selenium tool. The Selenium IDE, Selenium RC, Selenium WebDriver, and Selenium Grid. We will talk in detail about these components in the coming chapters.
- Download: This tab, lists the various downloadthat are required while setting up our system for using the tool.
- Documentation: It provides detailed help that may be required to learn Selenium. It also provides code examples, in different programming languages, which Selenium supports. It is very well written, and should be a one-stop solution for all Selenium-related queries.
- Support: The support page provides information on chat, user groups, and the organization that is providing commercial support for the Selenium tool.
- About: The about section talks about news, events, history of Selenium and how one can get involved in the Selenium activities.
Benefits of Selenium
- It supports multiple programming languages. You can code in Java, C#, Python, Ruby, and Perl.
- It supports automation of multiple browsers like IE, Firefox, Chrome, and Safari.
- It supports multiple operating systems like Windows, Mac, and Linux.
- It is available free of cost,
- It has a strong and active user community, which is very helpful.
Components of Selenium
- Selenium IDE: It is a tool used for recording and playing back scripts. It currently supports both Firefox and Chrome browsers. You can procure the tool from this link: https://www.seleniumhq.org/selenium-ide/
- Selenium RC: It was also known as Selenium 1.0. Although no longer supported, it was a combination of aSelenium server and a client, which allowed automation of any browser on any operating system.
- SeleniumWebDriver: Also known as Selenium 2.0, whose 3.0 version is now available. It uses the technology of WebDriver API, where every browser has the capability through its API
to automate itself. Currently the Selenium versions are released through the WebDriver technique of browser automation. - Selenium Grid: It uses server component from the Selenium RC, and executes it in two different modes as hub and node. This allows executions of multiple tests simultaneously, which saves time and cost.
Architecture of Selenium
- The client libraries available in different programming languages
- JSON wire protocol over HTTP for communication to send commands from client to server
- WebDriver for every browser
- Browsers: Chrome, Firefox, IE, Opera, and more
Conclusion
Questions
- Who created Selenium?
- Which Selenium component is used for record and playback?
- Why is Selenium popular?
- Which protocol does Selenium WebDriver use for communication?
- Is Selenium 1.0 still in use?