How to Display last item of a Combobox by using QTP?

Answers were Sorted based on User's Feedback



How to Display last item of a Combobox by using QTP?..

Answer / chandu

x=Browser("Browser Name").page("PageName").Weblist
("WebListName").GetRoProperty("items count")
Browser("BrowserName").page("PageName").Weblist
("WebListName").Getitem(x)
in this code..Weblist("WebListName")...this is the
combobox name...in web based application..qtp will display
"WEBLIST"...not "COMBOBOX"...

Is This Answer Correct ?    10 Yes 3 No

How to Display last item of a Combobox by using QTP?..

Answer / chandu

x=Browser("Browser Name").page("PageName").Weblist
("WebListName").GetRoProperty("items count")
Browser("BrowserName").page("PageName").Weblist
("WebListName").Getitem(x)

the above code will select the last item in the list box

Is This Answer Correct ?    7 Yes 5 No

How to Display last item of a Combobox by using QTP?..

Answer / snig

http://funandknowledge.blogspot.com/2008/04/qtp-script-for-
combo-box-control.html

Is This Answer Correct ?    2 Yes 0 No

How to Display last item of a Combobox by using QTP?..

Answer / chandu

Hi
that is a fine idea Ajreddy...u can put a msgbox so that u
can able to know which one it is selected and ...in the code
"x" contains the total number..so obviously if u write
getitem(x)it will select the last item

Is This Answer Correct ?    2 Yes 1 No

How to Display last item of a Combobox by using QTP?..

Answer / bhargavi

For web application it is not Combobox as mentioned above.
In windows application we will have combo box and here is the code for retrieving last item in combo box:

This example is explained using Flight application(Sample application given in QTP)

reqItem= Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
msgbox Window("Flight Reservation").WinComboBox("Fly From:").GetItem(reqItem-1)

Is This Answer Correct ?    1 Yes 0 No

How to Display last item of a Combobox by using QTP?..

Answer / prashanth chenna

Hi Chandu,(Any One)
I have a strong need of Descriptive Programing. If u have
material, will you send me please.
Thank u in Advance.


Regards,
Prashanth Chenna,
shanthc@gmail.com, shanthc@yahoo.com

Is This Answer Correct ?    0 Yes 0 No

How to Display last item of a Combobox by using QTP?..

Answer / chandu

iam really sorry...i don't have any material of descriptive
programming...
regards
chandu

Is This Answer Correct ?    0 Yes 0 No

How to Display last item of a Combobox by using QTP?..

Answer / ajreddy

hi
what ever chandu wrote its correct
Example:
x=Browser("micclass:=Browser).page("micclass:=Page).Getroproperty("items
count")
msgbox x ' Here u knows how many items r there in combobox

' after that which item u want u can get it
y=Browser("micclass:=Browser).page("micclass:=Page).Getitem(lastitemindexnumber)
count")
msgbox y

Is This Answer Correct ?    2 Yes 3 No

How to Display last item of a Combobox by using QTP?..

Answer / prashanth chenna

Hi,
Thank Q Chandu and Ajreddy. I cleared my doubt.
Thanks a lot.
Bye.........

Is This Answer Correct ?    1 Yes 2 No

How to Display last item of a Combobox by using QTP?..

Answer / prashanth chenna

Hai Chandu,
In the above code, in 1st line how can u find item count by
using GetRoProprety("item count"),then where is the
combobox name, from which it can count?

Is This Answer Correct ?    3 Yes 5 No

Post New Answer

More QTP Interview Questions

what is recovery manager and recovey scenerio?

2 Answers   BirlaSoft,


What are the main features we have to compulsory test by using qtp in an web based application

1 Answers  


What is dynamic arrays

1 Answers   Patni,


What are the different ways to invoke an application using QTP?

0 Answers  


explain how to write vb script in qtp?when will you write own script?

0 Answers   FirstApex,






for example one window is there, the window contains how many edit box's i want script? i know the script but that is not exact answer.... The script is like this .......... set a=description.creation() a("Native class")="WinEdit" b=window("Flight Reservation").childobject(a).count msgbox b if u found exact answer please getback to me? raju.ippali@gmail.com 9823257761

1 Answers  


write script for , launching fr window,login and create 5 elements array and store 5 order numbers inthat array? and open order by using order no.s in array and find out maximum tickets booked by which order?

1 Answers   TCS,


In QTP, As a first step wht we will do before going to start a Automation....when it will be decided that we have to go for a Automatio..and who will decide to go for Automation. Any body can pls let me know.. Thanks in Advance..

1 Answers   Wipro,


how to use the regular expression for the below code-- swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:56" There is a tree view window of the folder's ie Medication- >Pharmacy(sub folder)with 56 as count of records...The records can be different or if no records present in the specific folder..then it show "Paharmacy:-no records".Whe i record at the first time .....and try to rerun the same script with different records count say "pharmacy:800"..qtp is not regnizing it...therefore i want to user regular expression..but donot now how to use it and where to use...i have tried.... swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:\*"..but it s of no use..plz help..me

0 Answers  


How to load the object repository at run time?

1 Answers  


What are the most frequent errors you faced while executing your scripts?

1 Answers  


If there is a change in the object type eg: A button is changed as link, 1. How to edit that in the shared object repository. 2.What options are available to edit the object within shared object repository other than copy from loca; 3.What would be the effect of the change in Coded Scripts within QTP and Functions stored in .vbs file which are loaded and used in QTP

0 Answers   HP,


Categories