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?
Answers were Sorted based on User's Feedback
Answer / guest
Note : You need to take all the options of the weblist into
an array and try this logic
arr=array(1,2,4,1,2,6)
cnt=0
For i=0 to ubound(arr)
For j=0 to ubound(arr)
If i<>j Then
If arr(i)=arr(j) then
print arr(i)&"is repeated"
End if
End If
Next
Next
-Ganesh
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / sayani sur
Ganesh thanks for the answer but please provide clarification for below....
1. Can I use childobject.AllItem in place of getROProperty(items Count)?
2 . as u told i have to store all weblist items into an array..will u please tell me how can i insert these values/weblist items into an array...
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Answer / 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 |
Hi All, I need 5 yrs exp manual and automation testing using QTP sample resume. is there any body having please send me my mail id is bjr@aol.in Tahnks in Advance
In qtp,how to interact tool & application build?
Discuss quicktest professional (qtp) environment?
how to write the descriptive programming in QTP for remove the object value and substitute, with a variable then call the validation from excel
What is the main difference between QTP 8.0& QTP 9.2.And what r the features and benefits of QTP.
which tpye of exceptions mostly do we face in QTP
In Developer view it is a high priority defect & in tester view it is a low severity defect what is that how to define with an example
can u tell me the the cost of automation tool QTP ?
Diff between Test Stratergy and Test Plan? Diff b/w Test design ansd test case design?
did you perform retesting(DATA DRIVEN test) using functions with out using datatable methods how can you perform retesting using functions
pls guys understand this is question CAREFULLY,,, interviwer asks can u write test case for ATM m/c..i told, insert card enter pw...like this,,but interviwer not happy with that...ur not going to atm center? in ur office system ur testing ATM M/c...why ..how to test? what is the process?
Will down time for server and content maintenance/upgrades be allowed? how much?