![]() To take a screenshot of the webpage you navigated to, add the code snippet below: await page.screenshot() Conclusion Screenshots are a great way to capture information in your browser. Installing the dependencies will generate node_modules and a package-lock.json file as shown below: package-lock.json If this is your case, then go ahead and install the selenium-web driver module from the npm package manager by typing npm i selenium-webdriver -save. You only need to complete the last step if you want to run tests on an actual browser instead of just testing against web driver scripts. This part will walk you through the steps you'll need to follow to use Puppeteer in your tests: To use Puppeteer with Node.js, you'll need to install several packages and set up a few environment variables. How to Set Up Your First Test with Puppeteer Your output will look like this: package.jsonįollow the setup instructions to install the dependencies that we will use in our project. Press enter then type yes if asked 'is this ok'. Then run npm init to create a package.json file. Now open your terminal and cd into the folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |