Selenium Library or Browser Library in Robot Framework


I am new to Robot Framework and not able to decide which library (Selenium Library or Browser Library) to use for automating our application. Could you please suggest which is more reliable, fast and which has less cons & limitations.

This would help me a lot to start automating application at my work place.

Also is it possible to use both libraries (Selenium Library or Browser Library) within the same project (or even same test)?

Hi Ravi,

Are you trying to start a religious war? :rofl::rofl::rofl:

  • Selenium Library drives Selenium which is based on Java
  • Browser Library drives Playwright which is based on NodeJS

I have used both and found that both were more than adequate for my needs and probably for most users.
Browser Library has some obscure features out of the box that Selenium Library didn’t have however i’ve heard there are extensions for Selenium to implement them.
On the other hand Selenium Library can be installed with a simple pip install command, where as Browser Library requires you to install NodeJS first and run an initialisation script so it’s a little harder to get started.
If your AUT is NodeJS based I would say choose Browser Library, likewise of your AUT is Java based choose Selenium Library that way you’ll have developers familiar with the tech stacks if you run into issues, but otherwise I couldn’t give you a recommendation between them.


1 Like

Selenium based on Java? That’s the first time I hear that. And what the library is based on is really not of interest. Both “talk to” the DOM of a website.

Now the Selenium ecosystem is (much) older and there’s pros and cons because of that. The browser support is much wider than PlayWright, for example. Whether or not that’s relevant depends on your organization.

PlayWright works on engines, not browsers, and thus allows testing of Webkit on Windows, while you cannot test Safari on Windows using SeleniumLibrary. Another big benefit (to me) of PlayWright testing against the (vendored) engines is that things don’t randomly break when either Selenium, a SeleniumDriver or some browser is updated.

Also something to consider is that PlayWright has a wider scope than SeleniumLibrary. SeleniumLibary only works on the DOM, by design. PlayWright also has access to the network layer, so you can access the REST calls going back and forth and you can do things like wait for no network traffic for some timeframe.

In addition, PlayWright has support for ShadowDOM and iframes, which can be of importance.

As to faster and more reliable, PlayWright is generally the better choice for those criteria, due to its in-build waiting and auctionabilty checks.

Thankyou both. Apologize for the late reply.