@AfterScenario supports the variable uponOutcome to determine if the scenario has failed or not.

Else you can parse the XML of the story and  extract the scenario info.

On 10/04/2014 13:42, Hans Schwäbli wrote:
I achieved to create Java classes which can export test results into HP Quality Center by using its REST interface. But now I wonder how to extract the outcome from the JBehave run so that I can export the results. I want to export that in a very basic way: test result with an attached XML report. I identify the tests in Quality Center by using a Meta info per scenario: @qc-testcase Root/Test Folder x/Test Set y/My Test
This Meta info I can extract in a method like this:
@AfterScenario
public void afterScenario(@Named("qc-testcase") String qcTestcase) {}
Each scenario shall match a test in Quality Center.
My first idea was to export the outcome while the JBehave tests run. That would require to get to the information in a method annotated with @AfterScenario. But how can I determine in this method what outcome of the scenario is so that I can export that on-the-fly into HP QC? Another idea was to parse the genereated XML file after the run has finished. But it has no schema file. So I cannot generate Java classes for it by using JAXB in order to parse the result in a good way. Furthermore there is no total outcome result printed in the XML, only for the step outcome. Besides that I should have an XML file per scenario, so that I can attach it to the test result when I export it into HP QC, and I don't know if I can achieve that, so that JBehave procduces XML files per scenario.
How would you solve that?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to