Test Automation Using Python and Selenium

Introduction to Selenium

Selenium is an open-source automated testing framework used to validate web applications across different browsers and platforms. It was created by Jason Huggins in 2004, a Software Engineer at ThoughtWorks. He created it when he had to test a web application multiple times, manually leading to higher inefficiency and effort.

  • Selenium Remote Control (RC)
  • WebDriver
  • Selenium Grid

Why Selenium

The main advantages of selenium include:

  • Ability to support all Platforms and Browsers.
  • Ease of integration with most of the testing frameworks adding to the ease of creating test cases and generating test reports.
  • Ability to integrate with CI-CD application likes Maven, Jenkins, etc for seamless continuous testing.

Python for Automation Testing:

Python is the most easy-to-understand and learn programming language, at present. On top of that, it is completely open-source, high level, and is blessed with a large community to support. It also has multiple built-in frameworks for debugging, testing, and improved workflows.

Selenium Web Driver and Python Binding:

We Install the selenium library into our python environment using the pip package manager.

  • Name attribute of HTML tags
  • Links Texts
  • CSS selectors
  • Partial link texts
  • XPath of an element

Complete Example:


We will take an overview of the article here. In this article we learned about:

  • What is a Web Driver and how to use it
  • Basic Selenium Web Driver Locators
  • Saw the basic code and simple Demo of its usage.

Programmer | Writer | Philomath