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 |
how u write vb script in qtp pls give me some basic script and some material
32 Answers Datamatics, UHG, Winit,
What are the file extensions for per-action, shared object repository files and what is the extension for library files?
how to test power point using QTP 8.2 ? What are different methods to retrieve value from Application during runtime ?
Hai anyone please "Explain about Framework in QTP?"
hi, In A Table there are some columns and dynamic rows and in each row in first column there is a link with name. upon clicking on that link it will show some details. write the vbscript to check that link without descriptive programming?
what is framework and types of framework? Need of framework in automation? write folder strucuture of framework.
Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?
what is clean sweep?
I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?
How u send bugs to dev'lpment team all at once or one by one or waht is the process?
Why we use QTP ,We can use other tools like WR OrSilktest What r the options in Qtp that WR and Swilktest Does not have.
write vbscript in qtp tool for senario, in the given sheet add each number in each row and each colunm and show result