What Is Puppeteer?
Puppeteer was originally created by the Chrome/Google development team, Puppeteer automates Chromium based browser (Chrome, Edge, Brave and even Firefox). It runs in both headless and interactive mode. Headless being the default, it runs the browser emulation without needing to render it to screen.
With a massive 79.8k stars at the time of writing, this is one of the most popular libraries on Github, and is used by many organisations for many purposes ranging from test, to gathering information for several purposes. Adappt used this in 2020 to gather Covid stats from each govt for the World Health Organization.
The real power of Puppeteer is that it will faithfully render pages in the same way as Chrome / Edge, using the very latest release of the Chromium engine and all whilst running in headless mode. This makes it perfect for integration into CI/CD pipelines running on servers without GPUs
Puppeteer can be used for automated browser testing. It is fast and robust and has a ‘clean syntax’ that allows the user to write readable tests.
It runs under a NodeJS framework with an easy to use Application Programming Interface (API) that allows testing of code written for Chrome or Chromium browsers. By default, it is configured to run ‘headless’, which means no visible UI (User Interface); it is able to render and understand the HTML the same way a browser would.
- It can automate any action in a browser and can test various versions of each browser.
- It can test Single Page Automation (SPA)
- It’s very quick and with Chrome and much faster than Selenium.
- It can capture a timeline trace of the website, helping to diagnose performance issues. As Puppeteer communicates only through the DevTools protocol, it only supports browsers which implement this protocol.
A Built-in Feature for browsers
Puppeteer contains a ‘Recorder’; a built-in feature of chrome, allowing developers to and record actions as a Puppeteer script. This tool has an effective way to generate Puppeteer scripts giving efficient results, these are then configured to run automatically on the browser. As with all the other testing methods, when there have been different sets of codes, then the automatic script run through to identify the ‘bug’ that has been introduced.
Puppeteer With Jest and Other Extra Plugins
There is also a “Puppeteer Extra” project with useful plugins such as ad-blockers, re-captcha handling and others useful extras.
What Is Watir?
WATIR is an acronym for Web Application Testing In Ruby and is pronounced the same as the word ‘water’, it is a simple and flexible tool. It is an open-source family of Ruby libraries for automating web browser testing, and the Watir WebDriver (the modern version of the Selenium based Watir API), it drives/supports Internet Explorer, Firefox, Chrome, Opera and Safari browsers. It is a simple and flexible tool and facilitates the writing of automated tests which are easy to both read and maintain.
It interacts with a browser the same way a person or a manual tester would do, in effect it mimics a real person, it logs in, clicks on links, fills in forms, validates text and so on.
It also runs in headless mode (HTMLUnit).
What Is Webdriver IO?
Webdriver is an open-source project on GitHub which has been around since 2013. It has over 7k stars since the time of writing and is well maintained. Due to the ease in managing and with a respectable number of followers, this project has seen a growth in its popularity in recent years, in part due to the ease with which it can be managed. Its simpler architecture means it is faster than heavier frameworks like Selenium.
What Is Appium?
Appium is a freely distributed opensource mobile application UI Testing framework; an ecosystem of tools and libraries. It allows native, hybrid and web application testing and supports automation tests on physical devices as well as an emulator, simulator or both. It provides cross-platform application testing, i.e., a single API works for both Android and iOS platform test scripts. Platform examples are android, iOS, desktop apps (Windows, Mac) and now on platforms like Smart TV and much more.