jest-puppeteer

limit scope to an array of elementHandles (for selection/click/etc)

为君一笑 提交于 2020-01-25 06:59:08
问题 I'm using --> arrayOfHandles = await page.$x({SOME XPATH EXPRESSION}); To create an array of elementHandles to loop through and limit scope in the loop to each Handle: But It is not working!!!!! Given the following snippet of code: <div class="cameraList"> <div class="camera-row"> <div class="statsRow"> <div class="checkbox checkbox-primary"> <input id="Entrance" type="checkbox" readonly=""> </div> <div class="hasLocationIcon"> <svg version="1.1" id="locationChecked"></svg> </div> <div title=

Puppeteer finds the element in the wrong tab

家住魔仙堡 提交于 2020-01-24 20:41:05
问题 When ever I tried to click on the product, it opens in a new tab, where I perform text content operation. It returns null as puppeteer is searching the element in wrong tab const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ "headless": false, // "slowMo": 50, args: ['--start-fullscreen'], defaultViewport: null }); //Page const page2 = await browser.newPage(); let username = "g.rajesh690@gmail.com"; let password = "Nation20"; await page2.goto('https