Selenium vs. Playwright: just a few thoughts regarding this project - amauran/project-giskard GitHub Wiki

2023-03-11

So this is what happened...

This is a project where I am learning to use Robot Framework. I am not a coder, and I (currently!) have no work experience in the field :) (I am hoping to change that after this project :D) So everything we are doing, with the kind and more experienced help of my 'project leader', is new to me. And sometimes the learning curve seems a bit steep to climb all at once, so it's best to stop and think a bit.

From what little I had previously learned about Robot Framework, I knew that it required an additional library for web access, and that it was SeleniumLibrary, and it uses Selenium to work. But there is also another option called BrowserLibrary (a name that doesn't stick to mind as well as Selenium, so I was baffled for a while as to what it was called) that uses Playwright.

As I know very little about both, and we'd heard that BrowserLibrary was supposed to be the better and newer option, we decided to install that. To make it work, Playwright needed to be installed too of course.

And it did all work! For the few demos we found online and ran at least. But Playwright installed a ton of stuff I that, once again, knew nothing much about, apart from the familiar looking names of browsers that appeared on the endless seeming list. (And because of a mistake this all went in the totally wrong folder, but it doesn't matter...) It seemed a little excessive for my little project, and took a lot of space.

Wondering if Selenium might be better, I did a lot of googling, and read several articles about Selenium vs. Playwright and how they are similar and how they are different. Such as this one, and this one, that among other very informational things had a good lists comparing the properties of the two. Just google 'Selenium vs. Playwright' and you will find many more.

The main point that I got out of all those was: I can't learn all this in a day O_O

Well not just that. I did learn that Playwright apparently runs tests faster but Selenium has better community support, that BrowserLibrary should help you run tests through a single API thingie for all browsers, while SeleniumLibrary requires a separate webdriver installed for each browser it supports, and that Playwright runs tests 'headless' (without showing the GUI of the browser) and lacks support for real devices, whereas Selenium tests are more expandable in many regards. Still, honestly a lot of what I read did not mean much to me beyond the words I read.

But all that lead me to think about what I actually need, and don't need, for my learning process right now.

So eventually I decided to uninstall BrowserLibrary and Playwright, and installed Selenium and SeleniumLibrary instead, with only the webdriver for Chrome/Chromium. Because in the end, all I want to learn for now is how to run tests with Robot Framework, and for that all I need is one browser that I can use.

The rest can wait for later.