Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Edit HTML stylesheet to only display certain items

Posted on 2008-11-05
10
Medium Priority
?
609 Views
Last Modified: 2013-11-18
Hi guys,

Ive automated a web application using a tool called QTP. This tool provides results of a test run to the screen after a particular run. You can then export these results to a word doc or html format. My problem is that the stylesheet which it uses to export the results includes way too much information. Currently when i export to html format, the results include passed steps, warnings and other such information that i dont particularly need in my report.
I would like to just report solely on the failures of my scripts run. Therefore once my script finishes execution, i would have a list of failures only....not a list of passes, warnings, failures, which application objects were used, etc, etc.
Ive provided the stylesheet which im using....can someone please show me how i might be able to edit it so that it just includes the Failures when i export the results to html format?

Thanks
current-xsl-stylesheet.txt
0
Comment
Question by:DiCanio13
  • 6
  • 4
10 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22892779
Can you please also pass us an XML example.
It is not clear from your question what you need
0
 

Author Comment

by:DiCanio13
ID: 22892983
Hi Gertone,

I can only give you a screenshot of the xml output and also the standard report that is generated from the current stylesheet. Hopefully this will be enough information for you?
What i would like is to be able to edit the current stylesheet so that when i export the standard results to a word doc, only the "fails" will be included in the doc and not all the other status checks such as passed, warnings and done.

Im assuming this code in the stylesheet might need to be edited?

<td class="table_cell" > <!-- Status column -->
<xsl:choose>
<xsl:when test="NodeArgs[@status='Failed']">
    <span class = "Failed"><xsl:copy-of select="$IDS_FAILED"/></span></xsl:when>
<xsl:when test="NodeArgs[@status='Warning']">
    <span class = "Warning"><xsl:copy-of select="$IDS_WARNING"/></span></xsl:when>      
<xsl:when test="NodeArgs[@status='Passed']">
    <span class = "Passed"><xsl:copy-of select="$IDS_PASSED"/></span></xsl:when>
<xsl:otherwise>
     <span class = "Done"><xsl:copy-of select="$IDS_DONE"/></span></xsl:otherwise>      
</xsl:choose>
</td>
QuickTest-Professional-Report.doc
QTP-results-screenshot.doc
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22893022
well, this is very difficult without the source information, try this instead
<td class="table_cell" > <!-- Status column -->
<xsl:choose>
<xsl:when test="NodeArgs[@status='Failed']">
    <span class = "Failed"><xsl:copy-of select="$IDS_FAILED"/></span></xsl:when>
<xsl:when test="NodeArgs[@status='Warning']"></xsl:when>      
<xsl:when test="NodeArgs[@status='Passed']"></xsl:when>
<xsl:otherwise></xsl:otherwise>      
</xsl:choose>
</td>

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22893141
I am afraid that that is only deleting the titles.
I am afraid I can't help you without at least some view on the original XML
(you can get the original XML by replacing the stylesheet with an identity copy by the way, if this running in a bigger system)
0
 

Author Comment

by:DiCanio13
ID: 22919200
Hi Gertone,

From looking at the stylesheet, i think ive found where the solution to this might be -

<xsl:choose>
       <xsl:when test="child::*[position() = 2 and name() = 'Step']" >
             <tr>
                      <td class="table_hl" width="20%"><xsl:copy-of select="$IDS_NAME"/></td>
      <td class="table_hl" width="10%"><xsl:copy-of select="$IDS_STATUS"/></td>
      <td class="table_hl" width="10%"><xsl:copy-of select="$IDS_TIME"/></td>
      <td class="table_hl" width="60%"><xsl:copy-of select="$IDS_DETAILS"/></td>
            </tr>      
       </xsl:when>
       <xsl:otherwise>  </xsl:otherwise>
</xsl:choose>

If we were able to constrict the "when" statement to only include objects with a status of 'Failed', then i think it would work. Are you able to help with this?
0
 

Author Comment

by:DiCanio13
ID: 22919387
i was able to attach the xml, does this help you?
Results.txt
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22982613
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1000 total points
ID: 22982644
well, since points have been reduced by the admin on the follow up question because of the duplicate,
I would like to ask you to "accept" this one rather than just deleting it.
I am still trying to get this years "Points Earned Average", so deleted questions look bad on my statistics :-)

Please note that a lot of effort allready went to this question before you had the necessary info to start the follow up.
(you should not have started a follow up in the first place)
0
 

Author Closing Comment

by:DiCanio13
ID: 31513772
Follow up question, plus this one added up to 500 points
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22992386
thx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question