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



In google i'm going to search something like "rose", i usually get 10 results in..

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

In google i'm going to search something like "rose", i usually get 10 results in..

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

In google i'm going to search something like "rose", i usually get 10 results in..

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

In google i'm going to search something like "rose", i usually get 10 results in..

Answer / dinesh1433

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

Post New Answer

More QTP Interview Questions

In qtp,how to interact tool & application build?

1 Answers   Polaris,


How can we perfom Action and Component parameter.?

1 Answers   EDS,


Explain hybrid framework with advantages and disadvantages?

0 Answers  


What is the QTP test frame work?

3 Answers   IBM,


How to capture text from image to word

2 Answers  






How u call functions in QTP

5 Answers   Lehman Brothers,


i have .xls,.txt,.doc files are there (together). i want find only .xls file among them? how can we write function?

3 Answers   CTS,


How can i test an application like Google Earth.In my application data will be fetched from a oracle database based upon which graphs are generated..so these all are dynamic..how can i use qtp here..alongwith that how can i test the map generated by a satellite just like google earth..

0 Answers  


What is .Ini file in QTP?

3 Answers  


What are the main attributes of test automation?

3 Answers  


I am automating a Java application. This application is developed using SWT. I am not able to get the GUI object. Even i tried with Java add-in. In tutorial it states SWT is not supported any idea. Anybody worked in such appln. My question is whether it is possible to record the GUI object of SWT appln. how it is possible.

1 Answers  


How you r using QTP in u r project

1 Answers   IBM, Lehman Brothers,


Categories