For my web site testing, I created a script using Tampermonkey that randomly browses the site and modifies parameters. Sometimes I need to navigate to a different page by either using window.location.replace(URL)
or by clicking a button with the script like
document.getElementById('button_that_redirects').click()
. However, the script stops working after the new page is loaded.
Is there a way to run a JavaScript script that allows changing pages during execution? Do I need to use a different program instead of Tampermonkey?