Capturing JavaScript error in Selenium -
is there way capture errors occurring in dom
in selenium
, flag same error in page?
to give brief example, let's i'm trying bind event on non-existing html control, browser throws error saying:
element abcd not found in console.
now, if want same error fail selenium tests , message shown on browser shown error message.
is possible this?
here information on testing js errors.
http://www.silverwareconsulting.com/index.cfm/2010/6/7/checking-for-javascript-errors-with-selenium
put script on page , check in selenium jserror:
<script type="text/javascript"> window.onerror=function(msg){ $("body").attr("jserror",msg); } </script>
Comments
Post a Comment