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


Please Help Members By Posting Answers For Below Questions

what is supply chain management?

2091


How many number of actions possible in qtp?

606


We stored into the objects OR and then write the scripting

1546


What is the process of synchronizing qtp and aut?

571


Explain in brief about the quicktest professional automation object model?

517






hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]

1462


How do you send email with attachment from outlook using qtp ?

565


How does QTP identify an object?

615


I would like to directly import XL file and work on that XL file directly in QTp script in that XL sheet need to allocate workbench,XL sheet and generate two bar graphs automatically how to do that? plz let me know any answers?

1567


Explain how you can replace string in qtp?

607


what is ODC and GDC?

7355


What are the Test design techniques you uses in ur project?

1489


What is environment variable in qtp and why to use it?

551


Where we use data driver in qtp?

613


How many types of recording facility are available in quicktest professional (qtp)?

609