09-19-2012, 02:17 PM
Hi,
I need a favour from you guys, my QTP script is configured to open up a website, check for the content (that I fed into Object Repository) and accordingly throw a FAIL or PASS based on whether the content is found or not.
However, the script sometimes recognizes the content and at times cannot, and hence I receive false FAILURE alerts for unknown reason. Here's a bit of code snippet that causing irregular failures. Please assist.
I need a favour from you guys, my QTP script is configured to open up a website, check for the content (that I fed into Object Repository) and accordingly throw a FAIL or PASS based on whether the content is found or not.
However, the script sometimes recognizes the content and at times cannot, and hence I receive false FAILURE alerts for unknown reason. Here's a bit of code snippet that causing irregular failures. Please assist.
Code:
If Browser("ABC").Page("XYZ").Exist(0) Then
If Browser("ABC").Page("XYZ").Image("header_app_title").Exist(0) Then
sMsg = "Ineos Credit Control Tool page launch successful"
sStatus = True
End If
Else
sMsg = "Ineos Credit Control Tool page launch failed"
sStatus = False
End If