Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

write a vb script to display the reverse of vbs

2 Answers  


What are the rules to name variable in vbscript?

0 Answers  


Explain the constants in vbscript?

0 Answers  


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

0 Answers  


In what way program "hello world" you can write in vbscript?

0 Answers  






how to add the shared repository file to the script file while running the script manuall

2 Answers  


How to pass the parameter from one function to another function in VB Scripting?

1 Answers   Fastenal,


Could Anybody tell me VBScript for Check if a given number is Prime number-Don't use any Built- in Functions Boolean/int is Prime(int number).. Thanks in advance.

12 Answers   Amazon, Pyroferus,


How to insert snapshot during manual scripting in QTP?

1 Answers  


What is parametrization ?

9 Answers  


What is the output of a + b in vbscript if a = 5 and b = 10?

0 Answers  


hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?

0 Answers  






Categories