How to Display last item of a Combobox by using QTP?
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / snig
http://funandknowledge.blogspot.com/2008/04/qtp-script-for-
combo-box-control.html
| Is This Answer Correct ? | 2 Yes | 0 No |
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 |
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 |
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 |
Answer / chandu
iam really sorry...i don't have any material of descriptive
programming...
regards
chandu
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
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 |
When we use Object Spy? can we write QTP script before built is came in testing?
Explain the concept of Output values in Quick Test Professional?
Is QTP Object Oriented language or Object Based language? What are the OOPS concepts it will support? Why it wont support all the OOPS concepts?
There are some links on the page,count and click those links and check the text on the page displayed on clicking the link.write script for this scenario.
what is Supplemental Objects ?
A question was asked in a company-suppose, I am testing a website on QTP, all the time a new title bar is appeared on next page. Trying to use regular expression under key word driven testing but expert view is also appearing unchanged and error is also generating, do you have any best resolution for that kindly explain in detail. please dont give example of yahoomail, that is unable to clear my doubt.
What are the benefits of qtp?
How to use the object spy in quicktest professional 8.0 version?
How to use the Object spy in QTP 8.0 version?
what is the use of descriptive programming in QTP ? when we need to use DP? can we test the application completely with out useing DP?? please explan with example
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
How is recording done when a application is over lapping the QTP application it gives a message object not recorded