From 8d9106d362b7fd78063559c68fd945af3540a3c1 Mon Sep 17 00:00:00 2001 From: Yash Purohit <45822567+Y1a2s3h4@users.noreply.github.com> Date: Thu, 1 Oct 2020 12:51:12 +0530 Subject: [PATCH] Added Press Enter Code --- 1. basics/keyboard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/1. basics/keyboard.js b/1. basics/keyboard.js index afe7140..dad9b58 100644 --- a/1. basics/keyboard.js +++ b/1. basics/keyboard.js @@ -13,6 +13,8 @@ const puppeteer = require('puppeteer'); await page.goto('https://trix-editor.org/') await page.focus('trix-editor') await page.keyboard.type('Just adding a title') +// If you want to submit with button use this code. This will press Enter. +// await page.keyboard.press("Enter"); await page.screenshot({ path: 'keyboard.png' }) await browser.close() })()