Selenium has been in use since 2004 for tasks such as creating test suites for websites, taking screenshots, and automating tasks when APIs are absent.
Despite its utility, Selenium often earned a reputation for unreliability. Tests run could be flaky and fail intermittently due to non-obvious and hard-to-reproduce issues.
To counter Selenium's resource-heavy nature, programmers started leveraging headless browsers that carry out tasks of regular browsers but without displaying any content. PhantomJS emerged as a popular choice.
While useful for testing simpler websites, headless browsers fell short when it came to testing complex features of modern web applications, given the complicated nature of full browser emulation.
The browser automation landscape saw a significant shift in 2017 when PhantomJS, a popular framework for headless testing, was deprecated.
The deprecation of PhantomJS was primarily due to Google's announcement of headless Chrome, available from Chrome 59 onwards, introducing a new player in the automation field
Shortly after Google's announcement, Firefox also introduced a headless mode, further expanding options for efficient browser automation.
These developments paved the way for Playwright, enabling more efficient tests and scripts for browser automation.