Selenium C# - Catching Javascript errors -


i'm testing selenium web driver using c#. want check web pages no javascript errors present.

i have installed jserrorcollector.xpi firefox , added following lines code (taken here).

list<object> errors = (list<object>)((ijavascriptexecutor)_driver).executescript("return window.jserrorcollector_errors.pump()"); assert.isnull(errors); 

but brings following error:

window.jserrorcollector_errors undefined (unexpectedjavascripterror)

any ideas how fix or provide better alternative?

there no jserrorcollector_errors object in window, @ least when try access pump method. make sure when call pump function of jserrorcollector_errors object, object exists.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -