Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fail a test if the checkpoint passes
#1
Solved: 11 Years, 3 Months, 2 Weeks ago
I have the below code in my script. I would like to fail the test if the checkpoint passes. That means , if a particular unwanted text is displayed on the page, then I want to fail it. So I inserted a check point to check if the unwanted text is present. But when it is present the check point is passing and the test is also passing. Could you please suggest how to resolve this issue. How to find out what has been retunred to 'a'.?

Code:
a=Browser("Name").Page("Page").WebEdit("edit box").Check (CheckPoint("error"))

Code:
If a = Pass  Then
    reporter.ReportEvent micfail , "arrival date", "todays date not displayed"
End If
Reply
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
I would think it has to be If a = "Pass". You can have a msgbox after assigning capturing a to find out what it returns.
Reply
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
Thank you so much for your response. Can you please explain me more on how to get a msgbox with syntax and other req? I am new to VBscripting. Please help me and Thank you once again.
Reply
#4
Solved: 11 Years, 3 Months, 2 Weeks ago
msgbox a
Code:
a=Browser("Name").Page("Page").WebEdit("edit box").Check (CheckPoint("error"))
msgbox a
Reply
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
That worked great. Thank you soooo much for your help!!!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get the Parent Folder name in Test Plan for a Test from Test Lab using QTP godsown 0 6,108 09-29-2011, 04:55 PM
Last Post: godsown

Forum Jump:


Users browsing this thread: 2 Guest(s)