
So in our example, we shall run the following command −Īfter the command has been successfully executed, the browser in which the test is executed - Firefox/65.0 gets printed in the console. Step 4 − Execute the code with the command given below − Step 3 − Add the below code within the testcase1.js file created.Īwait p.setViewport() Step 2 − Enter a filename, say testcase1.js. Right-click on the folder where the node_modules folder is created, then click on the New file button. The details on Puppeteer installation is discussed in the Chapter of Puppeteer Installation. Step 1 − Create a new file within the directory where the node_modules folder is created (location where the Puppeteer and Puppeteer core have been installed). To begin, follow Steps 1 to 2 from the Chapter of Basic Test on Puppeteer which are as follows − Step 1 − We have to first install Puppeteer for the Firefox browser by executing the below command −Īlso, we have to add the Firefox-Puppeteer library in the code.

It must be remembered that while executing the test in Firefox, Puppeteer uses its internal Firefox browser and not the Firefox browser installed in the local system.

We can run the tests developed in Puppeteer in Firefox.
