Write your first test in Python Selenium

https://youtu.be/6ZaO4IA_4Wg

Let’s take a look at how to write your first browser test in Python using the SeleniumBase framework. You can check out my article here to learn more about the SeleniumBase framework.

⚙️ Setup & Installation

First off, we need to install the necessary packages and dependencies to set up our project. Here’s what we need to install:

  • Python3
  • SeleniumBase framework
  • Chromedriver (can be installed using SeleniumBase)

Check out my video below to see how to set up the project in PyCharm and install all the above packages –

✍️ Write your first test

Once all the packages have been installed, we can get started with writing our first test.

Scenario: Open the home page of the test website and assert the title and the logo.

🏃 Run tests in SeleniumBase

SeleniumBase relies on pytest as its test runner. So, just the way you would run tests in pytest, you can do the same in SeleniumBase also. Simply run the pytest command and it will start running your tests.

Once completed, you will see the results in a terminal similar to this –

Check out the video below to see how to write your first test in Selenium Python –

📧 Subscribe to my mailing list to get access to more content like this
👍 Follow automationbro on Twitter for the latest updates

I love coffees! And, if this post helped you out and you would like to support my work, you can do that by clicking on the button below and buying me a cup of coffee -

You can also support me by liking and sharing this content.

Thanks for reading!

--

--

--

SDET Architect | YouTuber | Tech Blogger | Love to explore new tools and technologies. Check out my YouTube channel — https://youtube.com/automationbro

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Ultimate Digitalocean Dokku Deploy Guide (Rails & other environemnts).

Native Vs Cross-Platform in App Development

Handle file uploads using a GraphQL middleware

What is Blue Green/ And What Blue Green is not

Ecosystem partnership between Arche Network and DeNet

Books on CI/CD for Developers in Tech Startups. Part 1.

A Blog On Strings | C++

Sharing cookies between different domains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dilpreet Johal

Dilpreet Johal

SDET Architect | YouTuber | Tech Blogger | Love to explore new tools and technologies. Check out my YouTube channel — https://youtube.com/automationbro

More from Medium

FindElement And FindElements In Selenium [Differences]

Regression Testing Simplified 2022

How to implement an object repository in selenium with .properties file

Running Selenium automation testcases using Jenkins