I have a list box which contains duplicate values e.g.
A,A,A,B,B,B,C,C,C.Now write a code in qtp to test the list
box .
Scenario #1 : I have to check whether any values are there?
Scenario #2 : If duplicate values are there,then how many
time it is getting duplicated?
Svenario #3 : how can I test presence of items in list box
ommiting duplicate values?

Answer Posted / ss

If duplicate values are there,then how many
time it is getting duplicated?

ItemsCount=Browser("creationtime:=0").page("title:=.*").WebList("name:=lccp_src_stncode").GetROProperty("allitems")

For i=0 to ubound(ItemsCount)
For j=i to ubound(ItemsCount)
If arr(i)=arr(j) then
print arr(i)&"is repeated"
End if
Next
Next

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Get the count of files of similar types from a folder.

975


Can you brief the hurdles you faced during Automation testing?

575


An action has both shared and local or associated to it and both have the same object in them. In the test which one will be considered?

654


How to use userdifined environment variables.Once we created in Environment tab which is at File--> Settings-- >Environment-->Userdifined

1465


What are the various automation frameworks available in qtp?

506






Describe synchronization point.

579


Which environments does qtp support?

679


What are private functions in QTP? How they can be called from the function library?

636


Can any one explain me what is the procedure to connect the remote desk by using QTP 9.2 ?

1517


Can we record using all the modes in a single script? Explanation with example is appreciated

1390


Explain about the test fusion report of quicktest professional (qtp)?

537


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1585


Tell me about qtp?

540


How to define array in qtp?

574


Why qtp always start action1 and does not start action?

601