Micro Focus QTP (UFT) Forums
Dynamic data - need to check if the value exists - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Dynamic data - need to check if the value exists (/Thread-Dynamic-data-need-to-check-if-the-value-exists)



Dynamic data - need to check if the value exists - egun - 08-11-2009

Getting an error "The step failed. The object was not found"
How can I insert a check to see if this value exists or not? To avoid having my test fail. Should I use an If Then Else statement? Or what do you suggest?

This is the step failing (below)- I am dealing with dynamic data so sometimes this will succeed and grab the output value but other times it will not if the value is not present.

Code:
Browser("V_2").Page("V_5").Link("Bot5").Output CheckPoint("storeBot5")



RE: Dynamic data - need to check if the value exists - Saket - 08-12-2009

As the error says "object was not found", you chould first check for the pbject whether it exists or not then do your output.
Yes, I think you should use IF Else statement for this.