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 happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?

2 Answers   Covansys, Systel,


How to record object in runtime. I am testing one Image website in which every time image change on home page.so if i records the image list but during running image get change, and QTP gives error

1 Answers  


Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.

0 Answers  


After running scripts how you report results ,there is any specific report form

5 Answers   Novartis,


What is CMMP and CMMH?

0 Answers  






What is log file?How to write log file code?

2 Answers   Apps Lab, Value Labs,


Do you have any knowledge about Business Processing Testing in QTP

1 Answers   TCS,


How to Import data from a ".xls" file to Data table during Runtime.

1 Answers   Crea,


how to make connection to a remote mysql database in qtp any one can please provid eme deatail steps.

1 Answers  


QTP -object reposistory spy tool is not able to spy the pop up message appearing in the application, so how is that i can handle such run time pop ups in QTP by code???

2 Answers   CGI,


When there is descriptive programming, why do we go for Object repository for desigining scripts.?? why cant we use descriptive programming instead of using the Object repository..??

4 Answers   DST Global Solutions,


Which is the best QTP training institute in Delhi/NCR region and what is the approximate fee for QTP course (Basics and Advanced)

0 Answers  


Categories