Micro Focus QTP (UFT) Forums
How to validate mandatory filed (*) in web application using - 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: How to validate mandatory filed (*) in web application using (/Thread-How-to-validate-mandatory-filed-in-web-application-using)



How to validate mandatory filed (*) in web application using - balak89 - 08-28-2015

There are 10 fields present in the application out of which 7 fields are mandatory. The Mandatory fields have (*) symbol as Web Element are present after the filed. Eg. First Name * (First Name is Web Element). Now how to validated * symbol is present after the mandatory fields.


RE: How to validate mandatory filed (*) in web application using - ADITI1992 - 09-13-2015

get all the objects name using child object methods.
get property of each one using getroprop
verify for "*"

Code:
str = Browser("My Account - Manage Subscripti").Page("My Account - Manage Subscripti").WebElement("* First name").GetROProperty("innerhtml")
For i=1 To Len(str)
    b= Mid(str,i,1)
If b="*" Then
msgbox "mandatory field"
End If
Next

Hope it helps..