Skip to content

Verifying Javascript Errors from browser

bglubiak edited this page Feb 5, 2018 · 11 revisions

Our test framework supports Javascript error logging from a browser. In case of any defined Javascript error, the test will fail and log details. To enable Javascript error logging you have to set below flag to trues (default) in App.config file: <add key="JavaScriptErrorLogging" value="true"/>

You can also define which Javascript errors will fail the test. Those ones are defined by default:

<add key="JavaScriptErrorTypes" value="SyntaxError,EvalError,ReferenceError,RangeError,TypeError,URIError,Refused to display,Internal Server Error,Cannot read property" /> In case of fail you will see below message:

Message: JavaScript errors were not found.>

And details in a log file:

2018-02-05 10:02:34.3895|Error|Objectivity.Test.Automation.Common.DriverContext.LogJavaScriptErrors|JavaScript error(s): http://the-internet.herokuapp.com/javascript_error 6:51 Uncaught TypeError: Cannot read property 'xyz' of undefined>

Clone this wiki locally