Micro Focus QTP (UFT) Forums
validate textbox - 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: validate textbox (/Thread-validate-textbox)



validate textbox - nirmal_k1231 - 05-03-2009

How to validate text box?
I have web based application, I want to validate text of text box,
The valid and invalid data is passing from data table.
Now validate mean i have a field named contact no. so it Should only accept numeric data. the text box is accepting all characters but validation of application is firing at when we press submit or save button. (if it is invalid then message is shown near by that text box is "Invalid")
I want to know from the result that particular which text field is accepting wrong value( which is passed from data table)
I tried this
Code:
If browser(a).page(b).web element("invalid").exist then
reporter.report event mic fail "Invalid","data"
else
reporter.report event mic pass "valid","data"

But it is always shows Fail in result even if we passed valid data from data table.
Help me about this Thanks in advanced