DEV Community

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

Posted on

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!

Top comments (0)