ganesh


{ City } mumbai
< Country > india
* Profession * sr qa engineer
User No # 105020
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 15
Users Marked my Answers as Wrong # 1
Questions / { ganesh }
Questions Answers Category Views Company eMail




Answers / { ganesh }

Question { NIIT, 12069 }

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


ItemsCount=Browser("creationtime:=0").page("title:=.*").WebList("name:=lccp_src_stncode").GetROProperty("items
count")
print "items count"& ItemsCount

if (ItemsCount)<>0 then

print "this is Items Count"&ItemsCount

End If

-Ganesh

Is This Answer Correct ?    5 Yes 0 No

Question { 9021 }

If there are some browsers opened and I don't how many browsers are open, Now I want to close all the browsers that I don't know how many are opened.
What would be Descriptive programming for this in QTP using VB Script..???
Please send your answers.


Answer

Set odesc=description.Create
odesc("micclass").value="Browser"
Set a=Desktop.ChildObjects(odesc)
print a.count
For i = 0 To a.count-1
browsername= a(i).getroproperty("name")
print browsername
Next

Is This Answer Correct ?    10 Yes 1 No