Readthedocs
pytest-selenium.readthedocs.io › en › latest › user_guide.html
User Guide — pytest-selenium latest documentation
Configuration options are specified using a capabilities dictionary. This is required when using an Selenium server to specify the target environment, but can also be used to configure local drivers. Simple capabilities can be set or overridden on the command line: pytest --driver Remote --capability browserName Firefox
python - Setting project with selenium and pytest - Stack Overflow
Recently I have started a new project with Selenium and Pytest and I'm not sure what is the best way to set up the driver and the general structure of the project. I have set up the driver inside More on stackoverflow.com
ELI5 Selenium, Pytest and Jenkins integration
Let's assume you have a webapp, and for simplicity sake, let's say it uses Django (Pytest, Python). A lot of functionality should be 'plain old python objects' can be tested witg unit tests, so write some simple tests using just the Pytest framework. Ideally all of these tests will run in a matter of seconds. Depending on the size of the project, this could end up being hundreds of 'parametrized' tests. Still they shouldn't take very long to run. (10-100 tests/sec.) To guarantee that the webapp works on all browsers, you want to write browser tests for it. That's where Selenium comes in. It'll allow you to write either generic browser tests (RemoteDriver) or browser specific tests (Firefox, Chrome, etc.). RemoteDriver is extra nice in that you can setup test nodes with Selenium server to run several tests at once. Needless to say, these tests will require a lot more time to run. One test could take 5+ seconds, but ideally each one will be less than that. It's worth mentioning, there's likely a lot of tests that aren't good candidates for unit tests and testing via a browser is overkill. In that case use Requests. Okay. Now you have a ton of tests and hopefully you have used Pytest's marks liberally. Any developer on the team should be able to run Pytest to run all of the tests to verify their changes. ++Good. Except nobody is perfect and people will try to merge failing code. So, you setup a Jenkins (I'm sorry. Me too. 😞) instance and hook it up with GitHub (Enterprise), Gitlab, Atlassian PoS(or whatever they call their hot garbage now; I'm so so sorry), etc. Every PR should kickoff a new test run to verify changes. If the tests fail, then Jenkins should tell the git server to prevent the merge. At the very least test the unit tests. Just unit tests should give sub 1min response. But, I would test everything. In my case 600 Requests based tests run almost as fast as unit tests, sub 2min, and the Browser tests... Oh, boy. Well, they started taking up to an hour to tests, so we parallelized the tests with pytest-xdist. Normally, with a library package, that's pretty easy thing to do, just install xdist and add the '-n10'. However, at least with our service, the webapp is configured per customer, so we can't have multiple tests changing the config while another test is running. Long story short, we moved most browser testing into Docker containers (Chrome, Fx) and the rest through an online service called Saucelabs (IE, Safari, mobile; there's also BroeserStack). After parallelization, our browser tests went from 1+ hours for several hundred tests down to 9min. With additional nightly runs through Saucelabs. Anyway, I've rambled. I'll do my best to answer any questions. More on reddit.com
Any python/test automation experts out there?
Allure for test results reporting
What's the most popular Python/Selenium framework?
Robot
DIY
How do I run pytest Selenium tests in parallel?
Install pytest-xdist with pip install pytest-xdist, then run pytest -n 4 to use 4 parallel workers or pytest -n auto to use all available CPU cores. For cross-browser parallel testing across different OS combinations, connect your fixture to TestMu AI's cloud Selenium Grid.
testmuai.com
testmuai.com › testmu ai › learning hub › selenium pytest tutorial
How to Use pytest with Selenium: A Complete Guide [2026]
What is the difference between pytest and unittest for Selenium?
pytest requires less code, auto-discovers tests without class inheritance, produces more readable failure output, and supports fixtures and plugins out of the box. unittest requires test classes that inherit from TestCase and uses verbose setUp and tearDown methods. Most Selenium testers choose pytest for its simplicity and scalability.
testmuai.com
testmuai.com › testmu ai › learning hub › selenium pytest tutorial
How to Use pytest with Selenium: A Complete Guide [2026]
What is a pytest fixture and how does it work with Selenium?
A pytest fixture is a function decorated with @pytest.fixture that runs before and after your test. In Selenium testing, a fixture creates the WebDriver instance before the test and calls driver.quit() after it using yield. Any test that declares the fixture name as a parameter receives the driver automatically.
testmuai.com
testmuai.com › testmu ai › learning hub › selenium pytest tutorial
How to Use pytest with Selenium: A Complete Guide [2026]
Videos
26:31
4 | Pytest Getting Started | Selenium Python - YouTube
21:27
Selenium Pytest Framework | Step-by-Step Tutorial - YouTube
23:05
5 | Selenium Pytest Examples | Selenium Python - YouTube
16:36
Selenium Python | How to use PyTest - YouTube
06:31:55
Pytest Selenium Python Hybrid Framework with Page Object Model ...
01:23:21
PyTest Tutorial | Selenium With Python | Learn PyTest In 90 minutes ...
GitHub
github.com › LambdaTest › pytest-selenium-sample
GitHub - LambdaTest/pytest-selenium-sample: Run test automation on cloud with pytest and LambdaTest. This is a sample repo to help you execute pytest framework based test scripts in parallel with LambdaTest automation testing cloud
Please refer to our PyTest Tutorial | Selenium With Python | Learn PyTest In 90 minutes | LambdaTest.
Starred by 16 users
Forked by 38 users
Languages Python 100.0% | Python 100.0%
Blazemeter
blazemeter.com › blog › pytest-framework
How to Use PyTest Framework to Improve Selenium | Perforce BlazeMeter
The session scope is what we are looking for to manage the Selenium WebDriver session. To create a fixture that will be shared across several tests, we need to put it in the file conftest.py. Any fixture in it will be recognized automatically. A fixture that starts the web browser looks like this: @pytest.fixture(scope="session") def driver_get(request): from selenium import webdriver web_driver = webdriver.Chrome() session = request.node for item in session.items: cls = item.getparent(pytest.Class) setattr(cls.obj,"driver",web_driver) yield web_driver.close()
TestingBot
testingbot.com › support › getting-started › pytest.html
PyTest Selenium testing with TestingBot
Examples on how to use PyTest to do Selenium & Appium testing on various browsers and devices.
Stack Overflow
stackoverflow.com › questions › 77315621 › setting-project-with-selenium-and-pytest
python - Setting project with selenium and pytest - Stack Overflow
Runs with pytest / python: from seleniumbase import BaseCase BaseCase.main(__name__, __file__) class LoginPage: def login_to_swag_labs(self, sb, username): sb.open("https://www.saucedemo.com") sb.type("#user-name", username) sb.type("#password", "secret_sauce") sb.click('input[type="submit"]') class MyTests(BaseCase): def test_swag_labs_login(self): LoginPage().login_to_swag_labs(self, "standard_user") self.assert_element("div.inventory_list") self.assert_element('div:contains("Sauce Labs Backpack")') self.js_click("a#logout_sidebar_link") self.assert_element("div#login_button_container")
TestGrid
testgrid.io › selenium › selenium python tutorial for beginners (step-by-step using webdriver)
Selenium Python Tutorial (WebDriver Guide & Examples)
June 26, 2025 - This Selenium Python tutorial showed you how to get started with Selenium with Python, from setting up Selenium WebDriver Python to writing your first automation script, handling waits, using PyTest, and applying best practices. With these skills, you’re ready to start building robust automation frameworks using Python and Selenium.
PyPI
pypi.org › project › pytest-selenium
pytest-selenium
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
Udemy
udemy.com › development
Learn Selenium with Python, PyTest & Frameworks
December 17, 2025 - This comprehensive Selenium course is designed to take participants from fundamental Selenium concepts to an expert level, providing a thorough exploration of web page interaction using Selenium.
Opcito Technologies
opcito.com › blogs › enhanced-test-automation-with-selenium-webdriver-and-pytest
Selenium and pytest for test automation
May 7, 2020 - This blog focuses on Selenium WebDriver & pytest framework, test automation using Selenium WebDriver and pytest, pytest Fixtures and parameters
GitHub
github.com › cvenkatreddy › Python-Selenium-Pytest
GitHub - cvenkatreddy/Python-Selenium-Pytest: Sample framework has developed with python, selenium webdriver, pytest and reports has generated with allure
pipenv run pytest -k "<tag_name>" --browser <firefox/chrome/remote/chrome_headless> view allure results: allure serve allure-results
Starred by 16 users
Forked by 6 users
Languages Python 100.0% | Python 100.0%