DEV Community

Cover image for Get familiar with the SeleniumBase API
Dilpreet Johal
Dilpreet Johal

Posted on

7 4

Get familiar with the SeleniumBase API

SeleniumBase framework comes with a set of pre-defined APIs or helper methods for us to use. In this post, we will get familiar with some of the common APIs such as click, get_text, assert_text, etc… and understand how it works and which ones to use when.

πŸ’­ Why use SeleniumBase API?

SeleniumBase API provides us with helper wrapper methods to use that are built on top of regular selenium commands. These wrapper methods make working with Selenium a lot easier as it comes with in-built smart wait features to make your tests more reliable. So, you do not have to worry about adding waits or sleeps after every other command, as all of that gets dealt with by SeleniumBase APIs.

It even comes with some additional helper methods which you typically would have to create on your own when directly using Selenium commands.


Scenario #1 – Click on a button and assert URL

Scenario1


Scenario #2 – Scroll and assert the text of the element

Scenario2


Check out the video below to learn more about the SeleniumBase APIs –


πŸ“§ 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 -

Buy me a coffee

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

Thanks for reading!

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

πŸ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay