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

Answer Posted / ganesh kumar

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

Is This Answer Correct ?    14 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

please any one can explain the keyword driven framework. with gmail example.

1613


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.

516


Explain about Test Fusion Report of QTP?

605


How do you create new test sets in td?

524


What are the advantages of qtp?

569






Tell me about your project? please help me how to tell about insurance project

1518


Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

1341


If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?

4680


What are the different ways to invoke an application using QTP?

639


Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?

609


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

1425


Discuss quicktest professional environment?

580


Hi All, How to get repeated word in string . Thanks Balaji

924


How to create scenario selector

1467


Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay

2651