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 / bhargavi
A small change is required in the logic.
arr=array(1,2,4,1,2,6)
cnt=0
For i=0 to ubound(arr)
For j=i to ubound(arr) <-- Not j=0 but take j=i so that comparison will not be repeated
If i<>j Then
If arr(i)=arr(j) then
print arr(i)&"is repeated"
End if
End If
Next
Next
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
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?
What is QTP testing process?
What are the differences between qtp and winrunner?
terminal services client
Shall we add Local Repository to shared object repository,if yes,how we add
What is the pros and cons between QTP and Rational Robot
Is it possible to split an action? How?
Name the different types of recording modes?
i need code for how to click on particular mail in utlook mail box .its urjent Thank You Balaji
What is keyword view in qtp?
What is the new version of qtp which is recently released in the market?
What is the default add-ins in qtp?
What is clean sweep?
what function you write to do database testing with the help of qtp?
what is meant by source control?