Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to capture QTPs results for each step
#1
Not Solved
Is there a way we can capture QTP's "result" and "Details" for each step, so that it can be passed onto an excel? Appreciate all your help... thanks
Reply
#2
Not Solved
Couldn't you just say...
Code:
If ..("Window"). ..("Screen"). ..("Field"). = "desired result" Then
DataTable("Results1", dtGlobalSheet) = "Pass"
Else
DataTable("Results1", dtGlobalSheet) = "Fail"
End If
..("Window"). ..("Screen"). ..("Field"). Output CheckPoint("Details1", dtGlobalSheet)

I've used this simple 'if' statement to do something similar to what you want.

The other way I can think of is to use QC to run the test from. QC will store the results and the details it used to pass/fail that test for each step.

I hope this helped.
Reply
#3
Not Solved
yeah, i've done that... But sometimes the framework we build, or what I've built, is not so foolproof... so i jus wanna capture QTP's results too and check if my framework is in sync... once things are stramlined i wudn need it anyway... so if anyone has an answer, pls help
Reply
#4
Not Solved
If your requirement is to pass the values to an external excel sheet then you will have to exploit the Excel COM object.
Code:
Set oExcel = CreateObject("Excel.Application")
Set oWorkbook  = oExcel.Workbooks.Open(sExcelpath)
Set oWorksheet = oWorkbook.Worksheets(1)

If ..("Window"). ..("Screen"). ..("Field"). = "desired result" Then
oWorksheet.Cells(1, 4).Value = "Pass"
Else
oWorksheet.Cells(1, 4).Value = "Fail"
End If

This would write in the 1st row, 4th column provided that is your results column. If you want to write it for all the tests please iterate through a For loop and use the counter in place of the row.
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
#5
Not Solved
Basanth,
I do not want write my own 'Pass' or Fail result based on conditions.... I want to capture QTP's results; the one that u see at the end of a run, wherein each step would have Pass, Done, Fail, Warning... Let me give an instance where the user and QTP can vary... I'm a novice, and while writing a click function, all i wrote was
if obeject.exist then
object.click
result="pass"
else result="fail"

Now, I've made the mistake of not checkin if the object is enabled.. so when i run this script, I wud get a Pass result (as programmed) where as QTP will fail the click event as the object is disabled... Now, all i wanna do is capture this QTP's result; here "FAIL".... Also, reporter.RunStatus is not what I want, cos that gives me the overall Run status... I want the status for every action performed.... Any help?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP does not record the first step of open filight reservation application. Blossoms 9 17,731 07-20-2015, 05:50 PM
Last Post: AJAJ
  step by step report shipu 0 2,150 08-06-2014, 02:21 AM
Last Post: shipu
  which is the final step of automation in QTP? Ramadas 6 3,903 10-29-2013, 04:31 PM
Last Post: Sathiya
  QTP is not recording the first step of opening Flight reservation app srinanduri 2 3,159 08-06-2013, 09:59 PM
Last Post: srinanduri
  How to continue test after it fails a step sqadri 4 4,553 01-20-2012, 10:02 PM
Last Post: sqadri

Forum Jump:


Users browsing this thread: 4 Guest(s)