views:

97

answers:

2

I am using selenium rc and I would like to know if there are any javascript errors occured in the page. Is there any Selenium API to check if there are any javascript errors? Thanks very much.

A: 

I know it's not Selenium, but I've found that for javascript FireBug is the best hands down imho. I know you are going for the "all in one" tool, but I'd consider making an exception in this case.

Joe Mills
Selenium RC is an automated web UI testing tool and serves a completely different purpose to Firebug.
cxfx
A: 

I'm not sure there's anything in the Selenium API that can do this. How about putting something like this after all your other JavaScript:

document.write('<!--JSOK-->');

then asserting that it exists from your test script? If the JavaScript has already thrown an error then <!--JSOK--> won't be rendered to the DOM.

cxfx