Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
TimeoutError: Timeout exceeded while waiting for event after click on button in autotest

Registration on the site consists of three stages. The first step is to provide a name, email address. When you submit the form of the first step, you are redirected to the second step (confirmation by email). The URL changes in the browser, and confirmation email sends to the mail. For implement the autotest, we decided that we would always register the same email address. For confirmation in the request for this email you will receive a confirmation link. Sample code below.

await page.click(btnSignUp)
const [response] = await Promise.all([
   page.waitForResponse((response) =>response.url()===apiURL+'/register'), 
   {timeout: 30 * 1000}
])
const responseData = await response.json()

After clicking on the "Register" button, I see the following page (confirm email), but I cannot get a response to the request. I see the response in the terminal when performing an autotest. But I got the error "TimeoutError: Timeout exceeded while waiting for event" What is the problem, help me figure it out, please.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I am attaching code snippet. You can use that and modify according to your scenario. It helps in dealing with timeout error related issues.

const puppeteer = require("puppeteer");
const { scrollPageToBottom } = require('puppeteer-autoscroll-down')

async function scrape () {

const browser = await puppeteer.launch({headless: false});
const page =  await browser.newPage();

await page.goto("https://twitter.com/elonmusk", {waitUntil: "networkidle2"});

let isLoadingAvailable = true // Your condition-to-stop

while (isLoadingAvailable) {
    try{
        await scrollPageToBottom(page, { size: 250 , delay: 500})
        await page.waitForResponse(
        response => response.url() === 'https://twitter.com/elonmusk' && response.status() === 200
        )

    } catch (ex) {
        continue;
        
    }
    isLoadingAvailable = false // Update your condition-to-stop value
}

console.log("Loading done")
await browser.close();
};
scrape();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!