Search code examples
javaseleniumjbehave

How to display complete stacktrace in Jbehave test report


I am using JBehave with Selenium Webdriver. When my automated tests fails it says the failure but it doesn't show the complete stack trace when the failure occures.

For instance I am trying to click one web element and it throws the below error. The complete stack trace is not displaying which is useful to analyse. So everytime I am keeping System.out.println(). Can some one help me to get rid of this.

[0m[31mThen I Click on Details New window (FAILED)
(org.openqa.selenium.WebDriverException: unknown error: Runtime.evaluate threw exception: TypeError Cannot read property 'click' of null
(Session info: chrome=38.0.2125.104)
(Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did   not provide any stacktrace information)
Command duration or timeout: 21 milliseconds

Solution

  • Now after configuring Configuration withFailureTrace to true I can able to display the complete stack trace instead of single line.

    new StoryReporterBuilder().withFailureTrace(true)
    

    This is the reference: http://jbehave.org/reference/stable/javadoc/core/org/jbehave/core/reporters/StoryReporterBuilder.html#StoryReporterBuilder()