TestProject Forum
Powered by leading experts in the test automation community

Disable javascript exceptions when running selenium code

Is it possible to disable the exceptions the browser is throwing while running webdriver test suites ?

You could possibly do it if you use HtmlUnitDriver.

You would need to override the modifyWebClient() method though:

public class HtmlDriver extends HtmlUnitDriver {
    protected WebClient modifyWebClient(WebClient client) {
        WebClient _client = super.modifyWebClient(client);
        return _client;