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 operator in VB Script?
how can you describe the basic flow of automation with conditional and programmatic logic?
how will b the questions if we keep one QTP project in CV.please tell me iam attending an interview.
What are the enhancements u did after recording ur script?
How to check feasibility of the appliction?in automation testing?
What is Object Spy in QTP?
How can we translate the steps between the Keyword and Expert Views?
How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric
What is post recovery scenario?
How Exactly we can find out the INDEX No. of any object of an application when we test that application in QTP? Explain this by giving me the example of all LINKS of G-Mail (including home page, User-account page and all possible pages you ever seen in G Mail)?????? and if your answer is that as per appearance of objects(LINKS) in application we can find out the index number in application then tell me how you find out which object(LINK) having INDEX No. 1,2,3 and so on and how you say which object(LINK) is appeared first and which is last?
How many ways we can parameterize data in QTP?
How can I replace all the text from the QTP script with some other text.