Micro Focus QTP (UFT) Forums
Exist statement executing when it should not - 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: Exist statement executing when it should not (/Thread-Exist-statement-executing-when-it-should-not)



Exist statement executing when it should not - mv8167 - 08-26-2011

I have the following code:

Code:
If Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebElement("No Results Found").Exist(2) Then
    Exit Function
End If

Even though the "No Results Found" dose not exist, the End Function gets executed.

Am I using this ide inncorrectly?

Update:

I changed my code to the followimng? It works, I think, now i am currious if it is correct QTP coding.

Code:
If Browser("Wisdom").Page("WisdomLogin").Frame("parent").WebElement("innertext:=No Results Found", "visable:=True").Exist(1) Then



Thx for your ideas.

Lorena