How create click loop on button with timeout? #14716

Open
danilkinanton opened this Issue Dec 21, 2016 · 0 comments

Projects

None yet

1 participant

@danilkinanton

How create loop click on button with timeout?
Clicks should occur on the same page.

  for (var i = 0; i < MAX_EVENT_COUNT; i++) {
                setTimeout(function () {
                    page.evaluate(function () {
                        var btn = document.querySelector('button');
                        if (btn) {
                            btn.click();
                        }
                    });
                }, 5000);
            }

But setTimeout is ignored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment