Selenium Python Articles
RSS feed75 articles found in Selenium Python
Find the Python code your tests never touch: set up pytest-cov, generate and read coverage reports, and gate your CI on a coverage threshold.
Idowu
October 14, 2025
28 min read
Learn web development using Python with Django, Flask, and FastAPI. Set up a project, build a working app, test it across browsers, and apply best practices.
Risper Bevalyn
September 16, 2025
31 min read
Learn how to build a web crawler in Python using Requests, BeautifulSoup, and Scrapy. Handle static/dynamic content, follow best practices, and avoid getting blocked.

Himanshu Sheth
September 1, 2025
42 min read
Learn how to use Python sleep() function with time.sleep() for delays, pauses, and timing in your code with real-world examples.
Idowu
August 15, 2025
24 min read
Learn how to pause code execution using Python waits with this step-by-step tutorial. Explore time.sleep, threading, and async waits with real-world examples.
Ini Arthur
August 14, 2025
23 min read
Learn Selenium Python step by step: install Selenium and pytest, write your first test, locate web elements, handle alerts and iframes, and fix common errors.

Himanshu Sheth
August 12, 2025
27 min read
Python's unittest.mock library, standard since 3.3, creates Mock and MagicMock objects and uses patch() to isolate code from dependencies during testing.
Ini Arthur
April 4, 2025
30 min read
Python tox is a command-line tool that automates testing across multiple Python versions and environments by reading a tox.ini file, creating isolated virtual environments, installing dependencies, and running test commands in each one. Combined with pytest and Selenium, it can run the same suite across Python 3.9 and 3.11 on both Chrome and Firefox.

Paulo Oliveira
March 19, 2025
25 min read
Learn about pytest fixtures, their benefits, and how they simplify test setup, teardown, and dependency management for efficient and reusable testing.

Himanshu Sheth
February 12, 2025
27 min read
Discover top Python testing frameworks for 2026. Elevate your testing processes with these 11 best Python testing frameworks.
Upendra Prasad Mahto
February 5, 2025
24 min read
Which are the top Python automation frameworks for Testing? We'll help you choose the right one for your Selenium automation testing needs. Find out more.
Aditya Dwivedi
January 30, 2025
29 min read
Master automation testing with Robot Framework Tutorial with Selenium and Python. Learn keyword-driven testing & achieve Agile, TDD goals with Robot Framework.

Himanshu Sheth
January 6, 2025
46 min read
Learn how to perform parallel testing using Pabot with Robot Framework. Enhance efficiency and optimize your test automation workflow!

Himanshu Sheth
January 6, 2025
30 min read
Python automation testing is the process of writing Python scripts, most often with Selenium and a framework like pytest or the built-in PyUnit, to automate repetitive front-end test cases such as registration, login, and cart flows instead of running them by hand. Python's simplicity and library support make it a favorite among testers for this kind of scripting.

Himanshu Sheth
December 11, 2024
22 min read
Explore 8 useful pytest plugins to enhance your Python automation, boost test efficiency, add reporting, handle fixtures, and improve debugging.

Paulo Oliveira
November 5, 2024
21 min read
Python automates web form filling with Selenium by locating input fields, dropdowns, radio buttons, checkboxes, date pickers, and file uploads, then sending values programmatically instead of typing them by hand. A working demo fills out a registration form's first name, last name, email, and password fields using Selenium's find_element and send_keys methods.

Paulo Oliveira
July 11, 2024
17 min read
Hypothesis testing in Python uses the open-source Hypothesis library to auto-generate test inputs with @given and strategies instead of manual test cases.

Jaydeep Karale
June 5, 2024
46 min read
Learn how Python's URL decode() method uses urllib.parse.unquote() to convert percent-encoded text back to readable form for accurate Selenium test assertions.

Paulo Oliveira
May 10, 2024
35 min read
In this blog, discover the ins and outs of using pytest skip test functionality: single, conditional, CLI, and more!

Paulo Oliveira
April 29, 2024
29 min read
Learn to download and setup Selenium ChromeDriver to effortlessly run Selenium tests on Chrome browser.

Urwashi Priya
March 27, 2024
20 min read
Learn how Selenium WebDriver locates and clicks radio buttons using Python, checks their selected state, and handles hidden radio buttons with explicit waits.

Paulo Oliveira
March 22, 2024
28 min read
Master the art of closing browser tabs in Selenium with Python and Java. Optimize your test automation with effective tab management.

Tanay Kumar Deo
March 21, 2024
41 min read
Utilize Chrome and Python Selenium to master the art of web automation while following best practices for fluid, effective, and dependable automation.

Jainish Patel
February 12, 2024
43 min read
Python automates WhatsApp messages through Selenium driving WhatsApp Web, the pywhatkit library for simple scheduled sends like pywhatkit.sendwhatmsg, or the Twilio Python SDK for the WhatsApp Business API. A custom user-data-dir keeps the Selenium session logged in so testers do not rescan the QR code, useful for sending automated test result notifications.

Paulo Oliveira
January 20, 2024
45 min read
Selenium's execute_script and execute_async_script methods let a JavaScriptExecutor run JavaScript code directly inside the browser during a test, manipulating the page's DOM in ways standard Selenium commands cannot. This Selenium Python tutorial explains when to use each method, covering scenarios like gesture and animation simulation, asynchronous interactions, and responsive scrolling.
Idowu (Paul) Omisola
December 12, 2023
48 min read
In this article, learn different ways of managing test execution time and how pytest asyncio helps reduce test execution time.
Milos Kajkut
November 30, 2023
13 min read
Struggling with NoSuchElementException errors? Learn Selenium wait for page load strategies like implicit, explicit, and fluent waits for stable tests.

Saniya Gazala
November 14, 2023
26 min read
A headless browser runs in Python and Selenium without rendering a visible graphical interface, executing the same page interactions in the background to cut resource use, in one measured example lowering Chrome's CPU consumption from 78% to 44%. Headless Chrome and Headless Firefox are the two browsers set up and driven through Selenium's WebDriver for automated testing and web scraping.

Paulo Oliveira
November 10, 2023
35 min read
For loop in Robot Framework helps you deal with repetitive tasks, enhancing test coverage while keeping your test cases readable and easy to maintain.

Paulo Oliveira
November 7, 2023
56 min read
Web scraping with Python extracts website data using BeautifulSoup, Scrapy, and Requests for static pages, and Selenium or Playwright for dynamic ones.

Himanshu Sheth
November 7, 2023
68 min read
Python Selenium checks whether an element exists using techniques such as the is_displayed() method, which returns True only when the element is visible on the page, while explicit waits confirm a dynamic element is present before interacting with it. Elements that exist in the page's source but stay hidden from users can still be located by class name or ID.
Idowu (Paul) Omisola
October 27, 2023
29 min read
Python takes screenshots during Selenium test runs using methods like get_screenshot_as_file, capturing the browser state at failure points for visual debugging and HTML test reports. Screenshots also support regression testing, comparing before-and-after images with libraries such as Pillow's ImageChops or OpenCV's absdiff() to catch UI changes that functional assertions miss.

Paulo Oliveira
October 18, 2023
41 min read
The Python end parameter sets what print() adds after each output, a newline by default. See how end='' keeps output on one line, with syntax and examples.

Paulo Oliveira
October 12, 2023
53 min read
Discover how to address Selenium pytest failures efficiently. Explore debugging techniques, best practices, and ensure a reliable test framework.

Paulo Oliveira
October 9, 2023
36 min read
Write a Python config file in INI, YAML or JSON, read it with configparser, and keep environment settings and secrets out of your source code.

Paulo Oliveira
September 29, 2023
72 min read
This Selenium Python tutorial deep dives into understanding pytest timeouts, including their configurations, handling exceptions, strategies, and best practices.

Paulo Oliveira
September 21, 2023
46 min read
Python XPath locates elements in Selenium by tracing a path through a page's HTML structure, used with find_element() and find_elements() under the By.XPATH strategy, plus get_attribute() for pulling attribute values like href. Outside Selenium, the lxml library, built on libxml2 and libxslt, applies the same XPath expressions to parse and manipulate HTML or XML documents directly.

Jainish Patel
August 10, 2023
36 min read
How monkey patching replaces Python classes, methods and modules at runtime, when it is the right call, the risks it carries, and safer alternatives.

Paulo Oliveira
August 7, 2023
55 min read
PhantomJS is a headless, WebKit-based browser that lets scripts control web pages through a JavaScript API for tasks like web scraping, automated testing, and screenshot capture. PhantomJS development stopped in 2017, and Selenium 3.8.1 deprecated its support in favor of headless Chrome and Firefox; headless Chrome scraped the same demo table in about 2.8 seconds versus 11 seconds for PhantomJS.

Jainish Patel
August 6, 2023
19 min read
Press Enter in Selenium Python without a WebElement using ActionChains or execute_script, with pytest code examples for a full working demo.
Idowu (Paul) Omisola
July 21, 2023
37 min read
Generate random strings in Python with choice(), choices(), sample() and the secrets module, plus which one to use for passwords, test data and IDs.

Jainish Patel
June 14, 2023
33 min read
Read and write INI config files with Python's built-in configparser: sections, read(), write(), defaults, and keeping credentials out of your test code.
Jolive Hodehou
June 13, 2023
28 min read
This blog delves into the benefits of test reporting and how to generate XML reports in pytest.
Jolive Hodehou
April 6, 2023
24 min read
This pytest Django tutorial will teach you how to test your locally hosted Django website on a cloud grid using Selenium.
Idowu (Paul) Omisola
April 5, 2023
43 min read
In this article, learn how to handle WebElements in Selenium Python while performing automated browser testing.
Eugene Kwaka
March 31, 2023
48 min read
In this blog on using Playwright for web scraping, you will learn how to set up Playwright with Python and use it to scrape data from web pages.

Jaydeep Karale
January 4, 2023
43 min read
This tutorial will help you find index of element in list with Python Selenium
Jolive Hodehou
December 22, 2022
17 min read
Selenium WebDriver combined with Python's unittest framework can automate file downloads that would otherwise require manually clicking a download button in the browser. In Chrome, Selenium sets the download.default_directory preference through add_experimental_option, while Firefox uses profile.set_preference calls such as browser.download.dir to control where files land.
Jolive Hodehou
August 12, 2022
23 min read
Selenium Python raises exceptions from its selenium.common.exceptions package, split into checked exceptions caught while writing code and unchecked exceptions that surface only at runtime and can produce fatal errors. Common ones include NoSuchElementException, TimeoutException, ElementNotInteractableException, and StaleElementReferenceException, and importing each by name from that package lets a test catch and handle it gracefully.
Eugene Kwaka
July 20, 2022
31 min read
Selenium WebDriver retrieves a page's current URL through its current_url property, letting Python testers verify navigation or assert keywords in the URL during automated checks. The environment setup relies on Pipenv to manage dependencies, installing Pytest and Selenium at versions 7.1.2 and 4.2.2 respectively at the time of writing.
Jolive Hodehou
June 29, 2022
18 min read
This Selenium Python tutorial deep dives into how to create an automated web bot in Selenium with Python; the learnings of which will be useful for multiple aspects of Selenium automation testing.
Vinayak Sharma
November 5, 2021
24 min read
Looking for a quick-start guide to Selenium Python commands for automation testing? Check out our Selenium Python cheat sheet that covers Selenium commands for web automation testing with Python.
Vinayak Sharma
August 16, 2021
31 min read
Read Selenium test configuration in Python using Python, JSON, YAML, INI, or XML files, with ConfigParser code examples and a cloud Selenium Grid demo.
Vinayak Sharma
July 16, 2021
17 min read
Selenium WebDriver's install_addon method adds a Firefox extension to a browser session it launches by taking the path to an XPI installer file and a boolean flag for whether the installation is temporary, since Firefox extensions installed locally are unavailable when Selenium launches Firefox. This Python tutorial downloads an extension's XPI file and calls install_addon to load it before testing.
Nishant Choudhary
June 9, 2021
14 min read
Web scraping with Selenium and Python automates a browser to load JavaScript-rendered pages, then parses the HTML with BeautifulSoup to extract data.
Vinayak Sharma
June 7, 2021
17 min read
Handle JavaScript alerts in Selenium WebDriver with Python using switch_to.alert, covering simple, confirm, prompt, and authentication alert types.
Praveen Mishra
May 31, 2021
20 min read
Nose2 is a Python test runner and the successor to Nose, extending unittest through the plugins branch of unittest2 to detect and execute unit tests automatically. Enabling its built-in plugin runs tests in parallel across multiple processes, and the framework also supports parameterized tests, fixtures, and logging, distinguishing it from both Nose and unittest2.

Himanshu Sheth
April 21, 2021
35 min read
Nose is a Python test automation framework that extends unittest, adding automatic test discovery and documentation collection, with version 1.3.7 still widely used even though Nose2 is its official successor. Installing Nose, writing fixtures, and running parameterized and parallel Selenium tests work the same way across a local or a cloud-based Selenium Grid.

Himanshu Sheth
April 16, 2021
27 min read
Learn parameterization in pytest with Selenium using pytest.fixture, @pytest.mark.parametrize, and pytest_generate_tests() for cross browser test automation.

Himanshu Sheth
March 20, 2021
40 min read
Page object model avoids code duplication and improves test maintenance. Read now and learn how to implement the POM design pattern in Selenium Python.

Himanshu Sheth
March 11, 2021
23 min read
Switch browser tabs in Selenium Python with current_window_handle, window_handles, and switch_to.window, or open new tabs using ActionChains and execute_script.
Nishant Choudhary
December 23, 2020
22 min read
Follow our comprehensive Selenium with Python tutorial. Learn how to set it up correctly and start using Selenium with Python for automation.

Himanshu Sheth
December 1, 2020
31 min read
Drag and drop is a common GUI gesture used across tools like Google Drive, Trello, and Jira, involving moving the cursor to an object, pressing to grab it, dragging it while held, and releasing it at the target. Selenium's ActionChains class implements this with a drag_and_drop method and a pixel-based drag_and_drop_by_offset variant, demonstrated on jQuery UI's draggable and droppable pages.
Nishant Choudhary
November 26, 2020
18 min read
Python works with Selenium 4 through relative locators (above, below, to_left_of, to_right_of, near) using the find_elements method, per this tutorial.

Himanshu Sheth
November 23, 2020
41 min read
Capture Python Selenium screenshots with GeckoDriver save_screenshot() or ChromeDriver screenshot(), then crop one element using PIL and XPath.
Nishant Choudhary
October 1, 2020
18 min read
Automated browser testing with Selenium Opera in Python drives the Opera browser through Selenium's WebDriver architecture, using the operadriver executable paired with Opera's binary location so Python test scripts, written with unittest or pytest, can open Opera, locate elements, and run the same assertions used for Chrome or Firefox.

Himanshu Sheth
August 21, 2020
22 min read
Save time spent on Selenium test automation by running tests in parallel. Read our PyTest Turorial with easy-to-do steps and elaborate examples. Learn more.

Himanshu Sheth
June 15, 2020
27 min read
Stop a pytest suite after repeated failures with @pytest.mark.incremental to skip dependent tests, or the maxfail command-line option to halt the run early.

Himanshu Sheth
May 26, 2020
15 min read
With pytest you can run multiple test cases from a single file, or even run selective tests with custom markers or by grouping tests. Learn more with this pytest tutorial!

Himanshu Sheth
May 11, 2020
23 min read
Perform simple and scalable automation tests with python and pytest. Learn how to run your Automation test script in with pytest in this Selenium Python.

Himanshu Sheth
May 5, 2020
20 min read
In this webinar, we will be going live with Andrew Knight(The “Automation Panda”), to help you perform extensive Web UI testing using Python and Selenium testing.

Harshit Paul
October 16, 2019
5 min read
In this webinar, we will be going live with Andrew Knight(The “Automation Panda”), to help you perform extensive Web UI testing using Python and Selenium testing.

Harshit Paul
October 16, 2019
6 min read
Hypothesis is a Python testing library for property-based testing: instead of supplying fixed inputs like traditional unit tests, you describe valid input types and expected conditions, and Hypothesis generates up to 100 test cases by default, including edge cases a developer might never think to write manually.

Himanshu Sheth
May 8, 2019
27 min read
Parallel testing runs multiple Selenium WebDriver test cases at once with Python's unittest module, instead of one after another, cutting execution time.

Himanshu Sheth
February 7, 2019
23 min read
PyUnit, also called unittest, is Python's built-in unit testing framework. Structure a Selenium Python test suite with setUp, tearDown and assertions.

Harshit Paul
January 7, 2019
18 min read










![7 Top Python Automation Frameworks [2026]](https://assets.testmuai.com/resources/images/meta/top-python-frameworks-for-automation.webp)









































![Tutorial on Python Read Config File Using Selenium [With Example]](https://assets.testmuai.com/resources/uploads/2021/07/how-to-read-config-files-in-python.jpg)



![Getting Started With Nose2 in Python [Tutorial]](https://assets.testmuai.com/resources/uploads/2021/04/selenium-python-nose2-tutorial.png)
![Getting Started With Nose In Python [Tutorial]](https://assets.testmuai.com/resources/uploads/2021/04/Nose-In-Python-1.jpg)















