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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / max

Replace micFail with micPass in Ganesh Kumar's Answer.
(See below the last part of his answer, ... now modified)

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

Is This Answer Correct ?    6 Yes 4 No

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

Answer / uday

here the question is how to find the max and min. lengths
the webedit accepts?

To find the max length of the web edit, try with "max
length" property.
temp=browser("Browser").Page("Page").WebEdit("username").GetROProperty("max
length"). It works.

I am not sure about the min. legth.

Thanks,
Uday.

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More QTP Interview Questions

How to handle dynamic objects in quicktest professional (qtp)?

0 Answers  


User defined function in QTP

2 Answers   Lehman Brothers,


Write a user defined function to count the no. of buttons existed in a webpage ? i dont want to use descriptive.create ()

1 Answers  


What are parameterizing tests?

0 Answers  


In keyward driven framework what will be the step for yahoo login page ,inbox logout,plz explain in detail

0 Answers   Yahoo,






How QTP integrate with application?

1 Answers  


What is synchronization point in QTP?

0 Answers  


In QTP , Test Director combination . what is the role of Test Director? How QTP Launching QTP in T.D ? If it is Winrunner possible. but QTP How it is possible?

1 Answers   IBM, TCS,


Hi,can anyone tell me How to found the number of 1's and 2's in the given format 1,1,2,2,3,3,4,2 using vbscript Thanks in advance

3 Answers  


How to use Regular Expressions in QTP? give an example.

10 Answers   ABC, Accenture, Ordain Solutions, SCL,


In QTP while testing 3 tier application, It is Java Based Application developed using Java, servelets and JDBC etc... and It is a Web based Application.. which Add-In do we need to select while testing ...Java or Web Add-In

6 Answers  


how can u put synchronization point in qtp,wat is exactly synchroniztion why we use it wat is benifit in qtp

13 Answers   College School Exams Tests, Mind Tree,


Categories