More control over what is printed out when an exception is caught
Is there a way to grab specific information from an exception when an
exception occurs?
For example when I call printStackTrace I get a lot of information...but
sometimes I get too much information and most of it is not things I need
to see since it's always the same information anyways.
At least when it comes to Selenium Webdriver, it first tells me what the
problem is
com.thoughtworks.selenium.SeleniumException: Element blah not found
at
org.openqa.selenium.internal.seleniumemulation.ElementFinder.findElement(ElementFinder.java:92)
at
org.openqa.selenium.internal.seleniumemulation.Click.handleSeleneseCommand(Click.java:35)
at
org.openqa.selenium.internal.seleniumemulation.Click.handleSeleneseCommand(Click.java:1)
at
org.openqa.selenium.internal.seleniumemulation.SeleneseCommand.apply(SeleneseCommand.java:35)
at org.openqa.selenium.internal.seleniumemulation.Timer.run(Timer.java:40)
at
org.openqa.selenium.WebDriverCommandProcessor.execute(WebDriverCommandProcessor.java:140)
...
Caused by: org.openqa.selenium.WebDriverException: ...
...
...
...
/code/pre
pAnd then it goes on to tell me things about the my environment,
capabilities (with another list of messages), and more caused by
information./p
pIt's a pretty long message, and I don't want it cluttering my log file.
Is there a way to omit all of the caused by related messages?/p
pI tried codegetMessage/code but it only says/p
precodeElement blah not found
/code/pre
pWhich is not useful. I would like to at least see which line it came from./p
No comments:
Post a Comment