I need to capture the “This site can’t be reached” whenever a bad url encountered from a long list of URLs. Does anyone know if there is a common element that can be used in “element exists” that applies to every webpage that successfully loads? since the selector doesn’t work when the site can’t be reached, I need to do it the other way by testing if the page loads successfully. the issue here is that the list of URLs are all random and different. thanks in advance
I see you have a solution but another suggestion (not elegant either) could you have scraped the text off the page and looked for the title of the website OR ‘phrases/words’ like ‘error, could not load, this site can’t be reached’ etc (build up a collection of these words based off screenshots).
Throw an error if you got a match on the error words.