Sitespeed script: accept javascript alert
Just imagine, you use sitespeed to monitor your website , and your website throws a javascript alert popup – this will usually throw some error. To fix this issue, you can try this script:
1 2 3 4 5 6 7 8 9 10 |
module.exports = async function(context, commands) { // Measure the page and give it the alias StartPage const driver = context.selenium.driver; const webdriver = context.selenium.webdriver; await commands.measure.start(); await driver.get('http://www.yoururl.com'); await driver.switchTo().alert().accept(); await commands.measure.stop(); }; |
Leave a Reply