getgauge / taiko

A node.js library for testing modern web applications
https://taiko.dev
MIT License
3.58k stars 453 forks source link

goto times out on redirect #2623

Open SzajJolanta opened 2 years ago

SzajJolanta commented 2 years ago

Discussed in https://github.com/getgauge/taiko/discussions/2622

Originally posted by **SzajJolanta** July 21, 2022 Hi. I have an issue. I have a dynamic list of certain URLs I have to visit (around 5000), some of them are not valid and the page loads for a split second on that URL, then it gets redirected to the home page again. I can not remove those URLs that cause redirects. I have to visit them and perform certain check. The thing is that when taiko's goto() lands on such URL, it stops and does not go further. The next iteration of the 'for' loop does not happen and timeout occurs. ` // arr <- this is dynamic array of URLs for (let i = 0; i < arr.length; i++) { await goto(arr[i], { waitForEvents: ['DOMContentLoaded']}); let currURL = await currentURL(); console.log(arr[i]) console.log(currURL) }` This sounds like similar issue to mine but can not find a solution for it https://spectrum.chat/taiko/general/i-am-having-issues-with-using-goto-when-the-page-redirects-it-doesnt-seem-to-detect-redirects-and-wait-for-redirect-to-complete-before-moving-onto-the-next-step~310440ec-9195-4928-814c-f764313c37c5 Please can you help me handle such redirects so the loop can go on?