Selenium IDE - checking for a 404 error

2.4k views Asked by At

Im trying to check if a url entered into the target field for the command "checkUrl" is valid or not using javascript, but i keep getting an error. There are multiple pages listed within the sites I'm testing and I have the need to verify if the pages have been added with the correct name, or even at all using the relative url.

Selenium.prototype.doCheckUrl = function(locator){
var request = new XMLHttpRequest();  

request.open('GET', locator, true);  
request.send();  

if (request.status === "404") {  
request.message = false ;

} 
}
2

There are 2 answers

0
Ektor On BEST ANSWER
0
Ektor On

You can also see the full discussion here : https://code.google.com/p/selenium/issues/detail?id=141

But, it seems that the dev team is opposed to this feature :(