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 |
Which functionalities of QTP used in banking project?
write progamming connecting QTP to database sql? this is question asked by interview? pls any answer this?
What is debugging? How you debug your script?
Is there anyone can tell me where I can download free or trial QTP? I tried HP website, it was not there anymore. If someone know, pls send me URL. Tks...
how to generate numbers in between to numbers suppose numbers in between 500 to 1000 in sequencies using vbscript
how to reverse a string with out using string or predefined function,ex:string is " i love india". the output should be like this "i evol aidni"
10 Answers Aspire, MNC, Omega,
What is the difference between Systemutil.run and Navigate.
I have 3 browsers i want to give facebook url in 2 nd browser using qtp
How we test web based application by using QTP
CAn anybody tell me how can I use QTP to capture any video in my application?I want to see the video file opened in my application after the tests are completed in tests results.Can anybody help me?
What are the main features we have to compulsory test by using qtp in an web based application
For Usability testing, which is preferable Automation or Manual?