Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to export the QTP Test results in to HTML file using script
#1
Not Solved
Hi All,
Could you please explain me about the exporting of QTP Test results in to HTML file using script (Not from the File menu)

Thanks,
Venkat.Batchu
Reply
#2
Not Solved
It seems that you are not looking QTP Help thoroughly!!! Tongue
It's an inbuilt feature from QTP, you don't need any script to do this.
The only thing you need to do is set some registry values.
Go to registry key - "HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\Logger\Media\Log"
set the value for "Active" value to 1 (which is 0 by default.)

This will create a parallel result in HTML while your script is running. Along with the normal QTP Result, one Log folder will be created in your result path's Report folder which will contain the HTML report step by step.
Reply
#3
Not Solved
Manabh -
This is not exactly true. What you specified above is only a mere html log report and not a detailed execution report. There exist a code where you will need to read the XML values from the results.xml and using the Pdetail.xsl or Pshort.xsl stylesheets you can convert a xml result to a Html result format.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Not Solved
Basanth,
Have you tried this one out? If not then I request you to please try it out & then quote. I am using this feature quite frequently. As this html file is more easier to transfer, whenever I need to show step-by-step reslts, I can transfer this file.
As you see in regular QTP result in Tree format, this HTML displays the same in columner format. It contains Each & Every Step executed by QTP while executing the script with time flag & it's status (Pass/Fail/Done).
Reply
#5
Not Solved
Tried, used, dusted and abandoned. Why dont you try this on your script,

When you sync a object to wait, can you use a while loop for say 30 counters and see the result on the log file ? Morever the display is in a very tabular format and as i specified is not clear to read when you have enormous iterations hapening. If you have been adjusted to it, I am extremely sorry to wake up the monster. However, on a side-line try to read through a xml file and convert it using the XSL stylesheet and find the difference.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#6
Not Solved
I am fully agree with Manoj, the log report itself is much described as in result viewer. also this helps when the result is incomplete.
although we can do the same as you suggested.

Venkat - may be you can try this as well. hope it will help you.
Code:
sResults = "C:\Results.xml"
sXSL = "C:\Program Files\HP\QuickTest Professional\dat\PDetails.xsl"
createHTML sResults, sXSL, "C:\Results.html"

Public Function createHTML(XMLFile,XSLFile, HTMLFile)
Set xmlDoc = CreateObject("MSXML.DOMDocument" )
Set xslDoc = CreateObject("MSXML.DOMDocument" )
xmlDoc.async = False
xslDoc.async = False
xslDoc.load XSLFile
xmlDoc.load XMLFile
outputText = xmlDoc.transformNode(xslDoc.documentElement)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set outFile = FSO.CreateTextFile(HTMLFile,True)
outFile.Write outputText
outFile.Close
Set outFile = Nothing
Set FSO = Nothing
Set xmlDoc = Nothing
Set xslDoc = Nothing
Set xmlResults = Nothing
End Function

Basanth-what do you mean when you say - "When you sync a object to wait, can you use a while loop for say 30 counters and see the result on the log file ?" does it show up at the result viewer?
also the report generated by xsl is much similar to the log report but with more organised and in readable format.
I think you should not ignore the existing Log report. that also helps in some or other way.

Reply
#7
Not Solved
I have never said that it's a readable, I have said that it contains each & every step to what you have said "This is not exactly true. What you specified above is only a mere html log report and not a detailed execution report.".
Again I have stated that this is much more easier to handle/transfer due to it's size.
"If you have been adjusted to it, I am extremely sorry to wake up the monster.".
For this, It's not the matter of adjustment, It's the matter of using existing features of QTP easily, instead of making a Tool for a Tool.
Reply
#8
Not Solved
Absolutely !! The feature cannot be ignored at any sense. This was made available to ensure that you have a quick Html report ready. However when your project size grows and you have huge scripts, this really becomes redundant. My only concern is, when you know that you can do it in a better way, then do it at first.

What i meant with the Sync is - In any applications when you try to use the waitproperty and you give say, 20 secs , the loop actually writes the number of times it iterated until it achieved the property. Imagine a script which may utilize this sync function to a larger extent. Your HTML log report simply becomes cumbersome to read through.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#9
Not Solved
If I understood this right - you want to say that if I use waitproperty then it writes all the iteration into the results until it reaches the property.
I dont feel it behaves the way you suggested, I have just tried to get that but I am not able to find anything mis-behaved there. let me know if I am wrong some where. Just trying to understand what exactly the case could be.

I any case the log report will give you exact steps which are there in result viewer.

Reply
#10
Not Solved
Yes, this is true, unless you don't report any thing or your statement doesn't include any QTP action statements (i.e. "Exists", "Set", "Get", "Sync"), QTP won't report these statements in report. If you loop for 30 iterations without any QTP action statements in it, you can't get anything from results that you have iterated for n number of times.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Rolleyes Snapshots - Test Results Bhadra 8 8,034 11-03-2014, 03:24 PM
Last Post: vinod123
  Using OR created in one system, not able to execute the test script in another system priyaang 4 3,478 03-27-2014, 11:02 PM
Last Post: priyaang
  How to find the latest modified file in QC11 current test attachment using QTP10 shiv.cse 0 1,884 07-23-2013, 01:25 AM
Last Post: shiv.cse
  capture screenshot using html code and view in QTP Test results Bhuvan 3 7,239 07-19-2013, 02:38 PM
Last Post: Bhuvan
  How can I send variable value to html property for descriptive programming in QTP ritugoyal 13 22,535 11-26-2012, 12:55 PM
Last Post: binny318

Forum Jump:


Users browsing this thread: 1 Guest(s)