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



i have developed the below QTP script to count the no of items available in the web list "Sel..

Answer / 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

More VB Script Interview Questions

what is event handling?

0 Answers  


How can you create a file object to work with the files in the vbscript language?

0 Answers  


How to check the particular window is exist or not with out using check points

2 Answers  


Whenever I use Wscript.Echo Qtp raising Run time error as 'Object required for Wscript' How I can create object for Wscript

1 Answers  


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

1 Answers  






can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.

0 Answers   Synechron,


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

0 Answers  


Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder

0 Answers   IBM,


Which operator is used to perform the comparison among 2 operands in the vbscript language?

0 Answers  


accept an email id & validate it .email id should not exceed 25 characters the mail id should contain 3 characters excluding domain name,@ and .(dot) the last 3 characters of the domain should be net,com or org

2 Answers  


How to find arry size in qtp vb script

2 Answers   Cap Gemini,


how to find greatest of n numbers!

3 Answers   Syscon,


Categories