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 |
RECENTLY I PLACED IN QTP..HOW TO IMPROVE VB SCRIPTS KNOWLEDGE? IAM STRUGGING TO WRITE THE AUTOMATION SCRIPTS? ANY BODY TELL HOW TO IMPROVE QTP SCRIPT SKILLS?
How to connect to data base?
Is it possible to map an image as standard Object or u've to treat as virtual? how to map an Dynamic image into standard object?
In Remote acess server how u run a test?
We are calling Actions in Expert View by using Run Action.but i want to know where we are saving the Actions Scripts.Pls explain??
Hi, every one aim new to automation testing(QTP),aim looking for software versions any. If any one can HELP me that will be great. Thank u.(9620427211,Bangalore)
what is the defference between calling ation and called action?
It is regarding VBScript, how to export our function results to ExcelSheet through VBscripting. Ex: I have written add function, that result should export to Excel.
Explain the differences between table and db checkpoints?
How we can add actions in the test using QTP?
How can we extract data like "Details","Result","Time" from the 'Run Error' result generated in QTP after run time errors are generated during a run & import the details etc...into excel sheet
How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?