Micro Focus QTP (UFT) Forums
Exist returns false with part of innertext - 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 returns false with part of innertext (/Thread-Exist-returns-false-with-part-of-innertext)



Exist returns false with part of innertext - Milindt43 - 02-18-2011

Following returns True with Full Innertext "Country Code: BE Currency Code: EUR"

Code:
Set Obj_WebElement=Description.Create()
Obj_WebElement("html tag").value = "TD"
Obj_WebElement("innertext").value = "Country Code: BE Currency Code: EUR"
Obj_WebElement("micclass").value = "WebElement"

If Browser(obj_Browser).Page(obj_Page).WebElement(Obj_WebElement).Exist (5) Then
Msgbox "Found Country & Currency Code"

But with part of innertext "Country Code:" followed by .*

Obj_WebElement("innertext").value = "Country Code:.*"

The same returns false

Can anyone explain why?


RE: Exist returns false with part of innertext - basanth27 - 02-23-2011

Probably there is more than one webelement with the same begining name..
To check add the object to the repository and regular r
Expression innertext and highlight in the application.
Does it point to the same webelement?