In google i'm going to search something like "rose", i usually get 10 results in the first page and in 2nd page 10 results and in 3rd 10 results so on upto 10th page 10 results. so if i want to open all the 10 pages 10 results i.e., 100 results and close..what is the DP for this? pls can anyone answer my Question..PLZZZZZ...
Answers were Sorted based on User's Feedback
Answer / gaurav anand
there would be many links in the google search page.Some are actual search results and some are ads and recommendations, ads etc.. So, first task is to classify these links. It can be achieved by using webtable concept as these links would be in different webtables. Now, fetch the links in the search results webtable by using the row and the child objects property. After that,for each link, open and close it and when this loop is done , click on the next page arrow present in the page in the outer loop.When this loop is done, scenario is covered.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sathya
Set odesc = Description.create
odesc("micclass").value="Browser"
Set Listofbrowser = Desktop.ChildObjects (odesc)
Counter = Listofbrowser.count
Msgbox Counter
For i=0 to Counter-1
val1 = Listofbrowser(i).Page("title:=Rose - Wikipedia, the free encyclopedia").WebElement("html id:=content").GetROProperty("innertext")
Msgbox val1
val2 =Split(val1, "rose" )
val2 = Ubound (val2)
Msgbox Val2
Listofbrowser(i).close
Next
Please correct me if am wrong.......Thanks
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / usha
Set d = Description.create
d("micclass").value="Browser"
Set browsers=desktop.ChildObjects(d)
msgbox browsers.count
Set od = Description.create
od("micclass").value="Link"
'od("index").value=j
od("name").value="Rose.*"
od("html tag").value="A"
For i = 0 to browsers.count-1
'msgbox browsers(i).getroproperty("innertext")
Set links=browser("creationtime:="&i).page("name:=.*").childobjects(od)
msgbox links.count
For j = 0 to links.count-1
msgbox links(j).getroproperty("innertext")
Next
Next
Is This Answer Correct ? | 0 Yes | 1 No |
If the each result page opens on the same window
set objHierachy=Browser("title:=Google.*").page("title:=Google.*")
With objHierachy
.WebEdit("name:=q")
.set "rose"
.WebButton("name:=btnK")
wait 2
'by default the search result shows in 1st page,
'so will write code for next 9 pages to see the result.
' if the next pages opens in the same window
For i=2 to 10
.Link("name:="&i).click
If i=10 then
.close
End If
Next
End With
Is This Answer Correct ? | 0 Yes | 2 No |
How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?
What are parameterizing tests?
how to add run-time parameter to a datasheet?
1 Answers Mphasis, Ordain Solutions,
What is a data driven test in qtp?
How will you handle application crash using recovery scenario manager(step by step process)?
actually how many hours per one day we will work on automation(qtp) in real time
How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric
how to select the work for complete automation and one more thing when u are going to choose automation
Explain how you can delete excel file in qtp?
What is the purpose of loading qtp add-ins?
Give me an example where you have used a COM interface in your QTP project?
Hi this is chandra if any one have Navigation of LAB QTP, I want Navigation of those tools, if any one have the and know the Navigation each and every part of the QTP, plz send me my mail naruboinac@yahoo. com,naruboinas@ gmail.com