< Back to Blog Overview

Codeless Automation with Puppeteer

2021-01-19
Codeless Automation with Puppeteer

If you're looking to create Puppeteer scripts, the following CLI program might be useful: Puppeteer Recorder.


This utility allows you to record all the actions you do in your browser and export these to a script. You can then modify the script to connect to the HeadlessTesting.com cloud and run your puppeteer tests concurrently in our cloud.


Installing Puppeteer Recorder


All it takes is npx @puppeteer/recorder "https://...." --output recording.js. This will open a browser and start recording all the actions you do in the browser window. When you stop the process, the browser window will close and you will see all the recorded actions in the recording.js file.


Now you can modify the script to connect to our cloud and you're ready.


Simply add this at the top of your script:

const browser = await puppeteer.connect({
  browserWSEndpoint: 'wss://chrome.headlesstesting.com?token=...'
})

const page = await browser.newPage()
and don't forget the browser.quit at the end of your script.

HeadlessTesting Logo

Sign up for a Free Trial

Start Headless Testing instantly.

No credit card required!