###Implement exception handling. The solution in these scenarios which worked for me is, **checking for console errors on each form submissions( post requests)** and raising the JavaScript error which needs to caught on global framework level so that solution is not scattered all over the framework and raised from individual 'it' blocks and caught on global framework level code which will be executed on after each 'it' block completion. This global code on detecting an (raised ) JavaScript error will immediately fail& terminate the current test and move on to the next test in the suite for the execution. > The key is to understand the AUT's internal structure and setup the > hooks at the right places.