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 |
In real time ,How to run all scripts in QTP? i,e in projects
WHAT IS A TEST STRATEGY & WHAT IS THE DIFFERENCE BETWEEN TEST STRATEGY & TEST PLAN?
21 Answers ABM, AZTEC, CTS, Infosys, Nihilent, Orange,
what is the difference between Reusable action and external action?
How to add Dynamic Objects to Object repository?
Hi, OUR PROJECT NAME IS: HOSPITAL CONTROL SYSTEM. IS IT COMES UNDER WHICH DOMAIN(HEALTH CARE OR HEALTH INSURANCE)
what is functions in qtp?i know the userdefind &bulit funation or i know that Private public function ?plz tell me what is funations in qtp?how to create a funation in qtp
i this is balaji from chennai i have 4 yrs exp in testing and my qualification is bsc computers i completed in correspondace in which companiies accept the correspondace plz let me know
which type of testing process are you following in ur company? how to recognize a qtp page?
What is the difference between Global and Local Data Sheets?
In descriptive programming how we know the properties of the objects, if application is not developed and the prototype of the application is also not developed.
What are the differences between QTP 9.2 and 10? please explain e indetail......
Can you write User defined function for WebEdit ? Note1: This function can be used for all web edits in all pages Note2: Don't use Child objects method