Benchmark: Puppeteer vs. Selenium vs. Playwright vs. WebDriverIO
blog.checklyhq.com
blog.checklyhq.com
def test_homepage(live_server, page):
page.goto(live_server.url)
assert page.innerText('#splash-quote') == 'our splash-quote'
$ pytest -k test_homepage --browser chromium --browser firefox --verbose
tests/test_browser.py::test_homepage[chromium] PASSED [ 50%]
tests/test_browser.py::test_homepage[firefox] PASSED [100%]What is that code doing that’s special?
When I was exploring that option, Playwright was still windows only. Super excited to see it is available on Linux and Mac.
However I don’t believe this testing methodology shows the true performance impact of the different frameworks. Only once you have a significant number of assertions and page interactions then to we really see the performance impact of the architectural differences.
Hope it's of some use to folks who may be struggling to compile lambda-chrome or with local testing.
I used Selenium a lot in a past life, so this post is interesting to see, but the UX and maintenance cost is also going to need to be factored in with bigger suites of tests.
With that said, if someone does want to use Lambda, it's easier than outlined in the article. Use one of the layers listed at https://github.com/shelfio/chrome-aws-lambda-layer and then `require('chrome-aws-lambda')` works fine, making it easy to throw something together even in the AWS console's own editor.
OpenFaaS is a great alternative that we will surely test drive.
AWS now supporting containers on Lambda will hopefully make shipping browser binaries to Lambda also easier.
It may be faster but that depends on browser too right? Which browser version pinned to same? There are many other factors too.
Why playwright > Puppetter
1. Playwright supports cross browser properly. You don't usually see errors on firefox in playwright 2. Maintenance (Just watch recent commits, issues etc) 3. Less bugs on playwright
It's been a long time since I did browser automation but it was always much uglier than that.
These new browser drivers look (dare I say) downright fun to write stuff in. It's really tempting me to think of some browser automation side project to play with over a weekend...
It is surprising, though, how much engineering is required to click a button.