Reputation: 198
Here's my code. So basically I have an element in the page that I will click. Im not sure if waitForNavigation is the correct function to use here but I want the page to load fully before proceeding on to the next step.
I could use waitForSelector as a workaround, but what if I dont have a fixed selector that I can search?
await Promise.all([
this.page.waitForNavigation(),
element.click()
])
Upvotes: 0
Views: 3419
Reputation: 6719
Use options.waitUntil
(doc)
await Promise.all([
this.page.waitForNavigation({ waitUntil: 'networkidle2' }),
element.click()
])
Upvotes: 2