Hi,
I have a similar requirement as mentioned in the 1st post. I have extended the JUnitSecurityReportCollector, instantiated it and added extra info to the failures/success. The problem i am facing is with this requirement/customization :
-" Each test step that has a soap request/response
should be hyper-linked to view this "
Here is snippet from my custom ReportCollector which 'tries' to achieve this.(from this post:
viewtopic.php?f=2&t=20827 )
if (result.getStatus() == TestStepStatus.FAILED) {
buf.append("\t\tRequest/Response File path: <a href=\""
+ pathToFile + "\"> ShowFile </a>");
}Now here is where the problem lies. The generated xml report file - escapes the '<' and replaces it <. (Rightly so i guess).
Snippet from generated xml report:
<failure...>... Request/Response File path: <a href="blah blah path to file"> ShowFile </a> ... </failure>When i build the this into html report using junitreport ant task - the '>' gets escaped too in resulting html doc. The resulting html page look like attached image
I have tried the below 2 options :
- adding a CDATA section so < isnt escaped (Same Output as above)
-removed the xml < and replaced it with '<' for the particalar a href tag. (Resulting html only displaying "Show File" as a plain text. Content of <a href is completely ignored - probably as it doesn't recognize the <a tag)
I have also gone through all the numerous forum posts and blogs regarding customizing the report. (It's thanks to those that i got this far anyway!) All of them seem to mention that they want a link to screenshots or request/response - but none unfortunately explain this part/problem. Each one is centered around providing a custom JunitReportCollector to add relevant extra info.
The only probable solutions i see
- manually overriding the junit-frames.xsl (or junit-noframes.xsl) - to somehow figure out that whenever <a is encountered - create an html link. (i am not sure if this will solve the problem either)
- parse the resulting html and reverse the replacement of <,> for the relevant portion.
Has anyone else encountered this (and hopefully solved it) ? Am i missing something ? I am not too great with xslt - so am trying to figure out other ways.
Any help is MUCH appreciated!!