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
What is parameter in qtp?
What are the advantages of parameterization ?
Did QTP prove efficient for your project? Yes or No, explain?
How did you resolve conflicts present in Object Repository?
What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)
Have you used xml check point in your project?
how can i pass a "cript"as a parameter in to a function
What is the difference between qtp and selenium?
How can we conduct U-I Testing by using QTP??????
If I change the object name in one action will it be updated in all the actions? Or not?
What is system testing and what are the different types of tests you perform in system testing?
How to remove associated function library?
Can anybody post some real time scenario in qtp? please its very urgent.
Please Don't mind .i want in detail the real time process i.e in each document what it contains.
The structure of keyword driven frame work is like a folder structure the different sub folder are 1-functional libray folder 2-object repository folder 3- database folder 4-appliction1.xls 5-initalzation vbs file 6-sequence file 7-driver script 8-test case list file My question is whether these are in a local server machine or in our pc.((whether It like Vss). can u give example of driver script(code)