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
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 |
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 |
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 |
What is throw Object?
how to identify the user defind varibles? plz tell me
There is one parent browser and 'n' number of child browsers on desktop. Write a code to close all the child browsers but parent browser should not be closed.
How to Test Dynamic links ?
How can you find Local Host Name by Using QTP?
In this bellow script QTP is not able to getting no. of Links from my Browser. Set desc=description.create desc("micclass").value="Link" Set obj=Browser("creationtime:=0").page("title:=.*").childobjects(desc) msgbox obj.count I am getting "General Run Error".Why QTP is not supporting my Browser,but its running fine in other system.Please help me to overcome this problem.
hou can we use vb script in qtp could u tell me breafly
How to use Environment parameterization? Explain with an example.
what type of frame work used in your company?
w is time parameter
What is the difference between wait and synchronization point?
How to "Turn Off" QTP results after running a Script?