Google has introduced a new library based on Chromium’s dev tool protocol. The library grants high-level API to interact with chromium and handle most tasks which you can perform using Chromium dev tools. The library is implemented in node.js and is really easy to get started once you install required packages using the node package manager.
……………………………………………………………………………………………………
Why Puppeteer?
Puppeteer flexes its muscle where selenium misses out. It is not just limited to interactions with the web application under test performing tasks like for e.g. interacting with dom, submitting forms, generating screenshots and pdf of web pages but also in intercepting network activity, throttling CPU and network, generating timeline trace and mocking API amongst some. The puppeteer can be easily be used to write end-to-end automation test suites with the benefit of getting a detailed timeline of the performance of all the assets (images, javascript files and so on).
Engineers can easily switch between headless and non-headless modes. While writing the automation suite, non-headless mode gives a good view of how the browser is interacting with the application under test and helps in debugging; just like in Selenium. But in production, we can execute suite in a headless mode as it reduces execution time and save resources.
……………………………………………………………………………………………………
Is it really that Good?
Yes, it enjoys the goodness of async code execution. You can always perform multiple tasks simultaneously following the latest javascript async await conventions. You can test the behavior of your application under different screen sizes. The network can be throttled on demand to find out how your application will run at low internet speeds. For e.g. if you want to test the error messages in an application when a user loses internet connectivity, puppeteer can easily handle such a scenario. Mocking APIs can also be achieved with utmost ease. For instance, if you want to test your “payment completed” screen but don’t want to go through the payment gateway flow, you can easily perform it with puppeteer by mocking the API response. With a detailed performance matrix, puppeteer can easily be used for performance testing.
So what are the drawbacks?
Google puppeteer supports only Chromium and Chrome out of the box. Third party implementations are available for Firefox and Internet Explorer. But they are experimental as of now and are missing a good chunk of the firepower. The documentation available is minimal as compared to selenium.
Why should you prefer Puppeteer over Selenium?
The targeted audience is the major deciding factor. If it majorly comprises of Chrome users you should go ahead with Puppeteer. Other factors include performing automation tasks which are not possible with selenium, like testing Chrome extensions, mocking API calls and so on. Selenium follows WebDriver protocol and has been from a very long time in the market compared to puppeteer hence itis better documented compared to puppeteer.
……………………………………………………………………………………………………
Conclusion
Puppeteer is a powerful library which has revolutionized the automation testing by overcoming functionalities missing in WebDriver protocol used by Selenium. Although it is still in the early stages, it promises a bright future, backed up as it is by the illustrious Chrome dev tools team.
……………………………………………………………………………………………………
If you have any queries in this field, talk to Mindfire Solutions. For over 19+ years now, we have been the preferred Software Development Partner of over 1000+ Small and Medium-sized enterprises across the globe.



……………………………………………………………………………………………………
Paula left that day, keeping her promise. After a week, they were at the office of that tech company. They discussed the proposition with the representative, who created the blueprint of an online portal where students could reach out to the best teachers/mentors in areas of academics, language and of course, music. Both the parties could set their priorities straight, with respect to the location, the level of expertise, and the price point. They could also come to mutual terms, regarding the time and place of the classes, in the portal itself.
Unlike other programming languages, PHP was designed with features to simplify web application development. In addition to being a mature web programming language, PHP has been evolving consistently. The new language features provided by PHP 7 enables programmers to improve performance of web applications without increasing memory consumption. The developers can further accelerate custom website and web application development by leveraging a number of full-stack and lightweight PHP web frameworks like Laravel, CodeIgniter, CakePHP, Zend, Yii and Slim. Likewise, they can take advantage of a number of robust PHP development tools to write web applications rapidly according to varied business requirements. They can even use these PHP development tools to extend various web frameworks.