0

The element is visible and clickable, but clicking the element is not working. Trying to catch exception and show the error message.

    try {
        element.click();
    } catch (WebDriverException e) {
        // how to print out error? also tried: System.out.println(...)
        e.printStackTrace();
       
        // how to catch exception/error from javascript?
       ((JavascriptExecutor)driver).executeScript(
             "arguments[0].click()", element);
    }

Questions:

  1. how to print out exception? Could not find the stacktrace in console(windows) or test report html.

  2. how to catch exception/error from executing javascript?

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.