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

what is the difference between call to copy action and call to an existing action

5 Answers  


After fixing the bug, the same bug is raising again and again in new builds what we have to do? That bug is high level bug.

4 Answers   V2 Solutions,


What are the types of properties that quick test learns while recording?

0 Answers  


w is time parameter

1 Answers   Syntel,


how to get the object count ?????????

8 Answers  


WHAT IS THE USE OF "FUNCTION GENERATOR" IN QTP?

9 Answers   CTS,


I am struggling to understand QTP more from descriptive programming point of view. Is it easy to learn good QTP in South india by good faculty than north india? I found a great lack of institution in here. can you suggest me better instituion. I am holding two years of experience in same company, is there possibility in south india for me?

1 Answers  


what is the difference between function and subroutine ....here every one knows theoretically...here my QUESTION IS WHAT IS THE MEANING OF FUNCTION CAN RETURN A VALUE AND SUB CAN NOT RETURN A VALUE .....WHAT DOE'S IT MEAN FUNCTION CAN RETURN A VALUE HOW FUNCTION CAN AND SUB CAN'T ....GIVE A EXAMPLE FOR BOTH ....HOW IT CAN AND CAN NOT...HELP ANDY ONE....

1 Answers   HCL,


I am facing an issue of object identification with the dropdown element of DHTML grid. When I tried to recognize these different dropdown objects, QTP identifies only one object for all the dropdowns. Hence, selection of different data from different dropdowns list is an issue. To overcome this problem, i have used Descriptive Programming technique by creating different object descriptions which have all the other properties same but differ only in one property i.e. ‘X’ location of the element on the screen. Hence, i have created distinct object descriptions that would allow us to select values in different dropdowns. The code is given below. But still I am unable to identify distinct dropdown objects. ‘Object Description for Dropdown Cell Status Set objCellStatus = Description.Create objCellStatus("micclass").value = "WebList" objCellStatus("name").value = "select" objCellStatus("x").value = 219 ------ ‘X’ Axis value for cell status drop down ‘Object Description for Dropdown Sub Segment Set objSubSegment = Description.Create objSubSegment("micclass").value = "WebList" objSubSegment("name").value = "select" objSubSegment("x").value = "319" ------ ‘X’ Axis value for sub segment drop down Please help... This is specific to DTML grid(Drop down object)

0 Answers  


On what document base Descriptive programming is written if build is not yet ready ?

0 Answers  


How do know the number of browsers opened?

0 Answers  


Waht is diff between SystemUtil.Run and invokeapplication

5 Answers  


Categories