How to add a failure from a VBscript function to the results. how can I implement the functionality of checkpoint functionality from by VBScript. For Ex: I want to record a failure if some calculations evaluate to false.

Editorial / Best Answer

Answered by: Guest

  • Feb 13th, 2006


Put a Function in the Library and call this :

Write_result Browser("sss").page("sscs").webElement("sss").check (checkpoint),"your step details"

For Ex:

Function Write_result(Flag,steps)
   Select Case Flag
   Case "True"
  Reporter.ReportEvent 0,"Debugger",steps
   Case "False"
  Reporter.ReportEvent 1,"Debugger",steps 
   Case 2
   Reporter.ReportEvent 2,"Debugger",steps
   Case 3
  Reporter.ReportEvent 3,"Debugger",steps
   Case 4
     Reporter.ReportEvent 4,"Debugger",steps
   Case Else
  Reporter.ReportEvent 1,"Debugger","Data entry error in the calling command"
   End Select
End Function

Showing Answers 1 - 2 of 2 Answers

asha

  • Feb 11th, 2006
 

Take the evaulation result in some varaible and now depending upon the result send the response in the result file through "Reporter function" of QTP

  Was this answer useful?  Yes

Guest

  • Feb 12th, 2006
 

Put a Function in the Library and call this :

Write_result Browser("sss").page("sscs").webElement("sss").check (checkpoint),"your step details"

For Ex:

Function Write_result(Flag,steps)
   Select Case Flag
   Case "True"
  Reporter.ReportEvent 0,"Debugger",steps
   Case "False"
  Reporter.ReportEvent 1,"Debugger",steps 
   Case 2
   Reporter.ReportEvent 2,"Debugger",steps
   Case 3
  Reporter.ReportEvent 3,"Debugger",steps
   Case 4
     Reporter.ReportEvent 4,"Debugger",steps
   Case Else
  Reporter.ReportEvent 1,"Debugger","Data entry error in the calling command"
   End Select
End Function

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions