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



How To write script in QTP For Field Validation Example: password Field is accepting A range 8-20 ..

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

How To write script in QTP For Field Validation Example: password Field is accepting A range 8-20 ..

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

How To write script in QTP For Field Validation Example: password Field is accepting A range 8-20 ..

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

Post New Answer

More QTP Interview Questions

The string is like POWER STAR PAVAN , write a script for this how to findout the number of "A" in the string ?

7 Answers   TCS,


What is the difference between two actions?

1 Answers   Wipro,


Hai anyone please "Explain about Framework in QTP?"

0 Answers  


what is smart identification?

1 Answers  


Actually what is Quality center..is it Test Director or some other tool..Anybody can expalain it in detail..Thanks in advance..

3 Answers   Sony,






We need to verify the user name & password in for the user validation. But we don't want to use the parameterization/ loop for user name and password. What is the way in scripting so that user & password will generate automatically.

11 Answers   Tech Mahindra,


What is SQL injection?

2 Answers   CTS,


Hi to All, My name is Aditya, i have 4 year exp in software testing (Manual Testing), but i try to shift my career now in automation testing. right now i have no exp or u can say i am not hand exp in live application. So please guide me, what i do ???? Can i join again automation course only practical which is live application. if u know any person who's expert in qtp and he/she ready to take my class i have our own and company laptop. If required i will pay amount please don't mind. Please help me, and i am also planing to join core java from coming 1st Aust (in seed) for only purpose the understanding script of Automation (QTP)... Please help me... I am waitting u r replay... Thank you Thanks again

5 Answers  


Differences between QTP & Winrunner?

2 Answers   Crea,


what is the difference between the modular framework and datadriven frame work

2 Answers  


How many test scripts are prapare in ur project(HeathCare Insurance).

1 Answers   Virtusa,


How to add object to object repository in qtp9.0 Suppose for brower yahoo home page

0 Answers  


Categories