Python Selenium Tutorials

Selenium Tutorials

In this we list out the Selenium Tutorial using Python, from setup and basics, to advanced learning.

Introduction

  • Overview of what Selenium is and how it works with Python
  • Setup Selenium for Python
  • Writing your first Selenium script in Python

Interacting with webpage and related actions

Window interactions

Locating elements

In the following tutorials, we will learn how to locate or find an element by id, class name, link text, name, partial link text, tag name, or XPath, in the given document, using find_element() function.

  • Overview of the different methods available for locating elements on a web page using Selenium in Python
  • Best practices for identifying unique and stable locators for web elements

Locating a single element using find_element()

Locating elements using find_elements()

Locating elements around an element

XPath

  • What is XPath
  • Writing your first XPath expression
  • XPath syntax
  • Using regular expressions with XPath to match complex patterns.

Form elements

Form interactions

Input Text

Dropdown

  • Selenium – Xpath for dropdown element
  • Selenium – Select a value from dropdown by index
  • Selenium – Select a value from dropdown by value
  • Selenium – Select a random value from dropdown
  • Selenium – Check if dropdown exists
  • Selenium – Iterate through dropdown list

Radio Buttons

Checkboxes

HTML Elements

Any WebElement

Checks

Attributes

Actions

Links

Paragraphs

Headings

  • Selenium – Get all the headings
  • Selenium – Get first heading
  • Selenium – Get heading text

Divs

Images

  • Selenium – Get all the images
  • Selenium – Check if image is visible
  • Selenium – Check if image is clickable
  • Selenium – Click on an image
  • Selenium – Get image alt text
  • Selenium – Get image size
  • Selenium – Get image src

Action Chains

We can simulate actions from input devices like keyboard, mouse, pen or touch devices, and wheel for scrolling.

  • What is Action Chain in Selenium?
  • Selenium – Click action
  • Selenium – Click and hold action
  • Selenium – Context click action
  • Selenium – Double click action
  • Selenium – Drag and drop action
  • Selenium – Key down action
  • Selenium – Key up action
  • Selenium – Move by offset action
  • Selenium – Move to element action
  • Selenium – Move to element with offset action
  • Selenium – Release action
  • Selenium – Reset action
  • Selenium – Send key action

Click

  • Selenium – Random click

Advanced Python Selenium Techniques

  • Using implicit and explicit waits to handle page loading and element visibility
  • Handling pop-up windows
  • Handling alerts

JavaScript

Problems – Solutions

⫷ Previous tutorialNext tutorial ⫸

Quiz on Selenium

Q1. What is a web driver in Selenium Python?

Not answered

Q2. Which of the following is not a popular web driver used in Selenium Python?

Not answered

Q3. What is the method used to find web elements in Selenium Python?

Not answered

Q4. Which of the following is not a method to wait for a web element to load in Selenium Python?

Not answered

Q5. What is the method used to navigate back to the previous page in Selenium Python?

Not answered