Best tool to use for a quick standalone piece of web automation run from the command line

I’m looking to write a fairly simple piece of web UI automation to perform a few actions across a few pages. It’s going to be standalone so doesn’t require a proper framework etc.

Scenario is that I have some mobile automation that I can run from the command line, and I’d like to be able to run a subsequent piece of web automation also from the command line and ideally wrap the two within a bat file, so I’m looking for advice on the simplest to use, best performing and most stable tool out of the likes of Selenium, Cypress, Playwright, Pupeteer etc.

Posted Jan 24, 2023, 12:16 PM UTC

59
ShellInTheGhost•

Selenium is a “proper framework” but it’s pretty simple to use for simple tasks and is one of the most widely used.

Here is an example in python https://selenium-python.readthedocs.io/getting-started.html

4
justtowelie•

Honestly go for playwright, it's so nice out of the box and has a lot to offer, and it's fast. https://playwright.dev/

I've used playwright, cypress, selenium, webdriver.io And playwright has been my preferred choice, to the point where our new projects in my current company have switched to playwright when we were using selenium before.

2
__boba__•

Playwright is 100% the answer here with similar experience above - it has modern ergonomics while being lightweight and test-agnostic (if you're just using `playwright` and not `playwright/test`).

It's also very performant against the rest of the field.

1
simonsglcfcOP•

Thanks, it turned out pretty easy to use and even had a nice VSCode extension for recording/running tests. Did run in to one annoying issue which meant the test isn’t fully automated and requires one click, Playwright has no way to deal with security certificates unfortunately :/

1
needmoresynths•

it's really personal preference as any of the tools you listed would do this equally well, but puppeteer would be the most lightweight

1
Achillor22•

Selenium will do what you want but I wouldn't write an entire automation suite just for a simple one off test that sounds like it can be done manually.

0
simonsglcfcOP•

They’ll all do what I want to a certain extent but I was looking for advice on the optimal one to use for this scenario. It’s an action that can be repeated given some information and the process could be sped up and improved by not having to do it manually.

1
Achillor22•

Can you explain what the process is then?

1
simonsglcfcOP•

It’s approving an account after Onboarding, checking a number of checkboxes, selecting information from a dropdown, clicking on multiple buttons etc.

1