01-28-2010, 12:10 PM
Observe the below code, how the 2 'search' button of 'www.google.com' works using ordinal identifier.................
Code:
SystemUtil.Run "iexplore.exe","google.com"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Set "QTP script"
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q").Submit
Wait(5)
Browser("name:=QTP script - Google Search").Page("title:=QTP script - Google Search").WebButton("name:=Search","index:=0").Highlight
wait(5)
Browser("name:=QTP script - Google Search").Page("title:=QTP script - Google Search").WebButton("name:=Search","index:=1").Highlight