Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How To write script in QTP For Field Validation Example: password Field is accepting A range 8-20 characters only. How to write script?




515
views
asked marvit August 20, 2014 02:43 AM  

How To write script in QTP For Field Validation Example: password Field is accepting A range 8-20 characters only. How to write script?


           

1 Answers



 
answered By Dharma   0  
Dim strTextValue

strtextValue = Browser("Browser").Pge("Page").Frame
("Frame").webEdit("Password").GetRoProperty("value")
If strTextValue <8 Then
Reporter.ReportEvent micFail,"Check for the Feild
validation","The Feild is accepting Lesserthan
lowerBoundary value"

ElseIf strTextValue>20 Then
Reporter.ReportEvent micFail,"Check for the Feild
validation","The Feild is accepting Greater than
UpperBoundary value"

Else
Reporter.ReportEvent micFail,"Check for the Feild
validation","The Feild is not accepting lesserthan or
Greater than the Boundary value"

EndIF 
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert