i have developed the below QTP script to count the no of
items available in the web list "Select a product" in
www.bankrate.com and also want to print what are the
items??? can any one help me to rectify the below script???


SystemUtil.Run "iexplore.exe","www.bankrate.com"
a=Browser("title:=Mortgage Rates Credit Cards Refinance
Home CD Rates by Bankrate.com").page("title:=Mortgage Rates
Credit Cards Refinance Home CD Rates by
Bankrate.com").Weblist("name:=select").GetTOProperty("items
count")
msgbox a
Dim List()
ReDim List(a-1)
For i = 1 To a
List(i-1)=Browser("title:=Mortgage Rates Credit Cards
Refinance Home CD Rates by Bankrate.com").page
("title:=Mortgage Rates Credit Cards Refinance Home CD
Rates by Bankrate.com").Weblist("name:=select").GetItem(i)
Print List(i-1)
Next

Answer Posted / vasanth

Even though i gave you solution, I would like to suggest
you how to debug better in DP.
structure here is
browser>page>webtable>weblist
try to print a property from browser and then page and then
webtable. Rather then trying to get the value from your
last element.Example
a=Browser("title:=Mortgage Rates Credit
Cards.*").getROproperty("name")
msgbox a

and next check page
a=Browser("title:=Mortgage Rates Credit Cards.*").page
("title:=Mortgage Rates Credit Cards Refinance Home.*")
getROproperty("url")
msgbox a

In this way you will know when do you have problem in the
structure. I hope this helps you debug more of DP problem.
have a nice one.


Here is correct script,

SystemUtil.Run "iexplore.exe","www.bankrate.com"
a=Browser("title:=Mortgage Rates Credit Cards.*").page
("title:=Mortgage Rates Credit Cards Refinance
Home.*").WebTable("name:=select","text:=2.Select a
product: 30 year fixed 15 year fixed 5/1 ARM.*").Weblist
("name:=select","html
id:=selProductTypePurchase").GetROProperty("items count")
msgbox a
Dim List()
ReDim List(a-1)
For i = 1 To a
List(i-1)=Browser("title:=Mortgage Rates Credit
Cards.*").page("title:=Mortgage Rates Credit Cards
Refinance Home.*").WebTable("name:=select","text:=2.Select
a product: 30 year fixed 15 year fixed 5/1 ARM.*").Weblist
("name:=select","html id:=selProductTypePurchase").GetItem
(i)
Print List(i-1)
Next

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the functionality of vb script?

563


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

527


What are keywords in the vbscript language?

513


What is event handling in vbscript?

589


What is byref and byval parameters in vbscript?

596






How many types of operators are available in the vbscript language?

529


What is the difference between a dictionary and an array?

567


Explain the asc function?

498


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

1866


Mention what is variant in vbscript?

546


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

2482


What is the difference between for loop and while loop?

539


How will you get the octal value of the given number in vbscript?

491


Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks

1707


What is variant in vb script?

616