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:
how to print out exception? Could not find the stacktrace in console(windows) or test report html.
how to catch exception/error from executing javascript?