07-31-2010, 07:41 AM
Hi,
I have a somewhat similar query:
I have been trying to write a script that will do the following:
1. Open Google in IE
2. Search for a string (e.g., testing),
3. Click on Google Search button and then
4. on the search results page clicks on the topmost link.
I have written the following piece of code but am stuck at the step where the script is supposed to click on the topmost link in the search results:
Can anyone please help me with the above script?
(By the way, when you try to see the object hierarchy for the links in the search results the Object Spy does not show a Webtable to be part of that hierarchy.)
Thanks,
Neeraj
I have a somewhat similar query:
I have been trying to write a script that will do the following:
1. Open Google in IE
2. Search for a string (e.g., testing),
3. Click on Google Search button and then
4. on the search results page clicks on the topmost link.
I have written the following piece of code but am stuck at the step where the script is supposed to click on the topmost link in the search results:
Code:
SystemUtil.Run "iexplore.exe", "www.google.com"
Browser("title:=Google - Windows Internet Explorer").Page("title:=Google").webedit("name:=q").Set "testing"
Browser("title:=Google - Windows Internet Explorer").Page("title:=Google").webbutton("name:=Google Search").click
Set myLink = Browser("title:=testing - Google Search - Windows Internet Explorer").Page("title:=testing - Google Search").SelectRow 1
wait(2)
myLink.click
Can anyone please help me with the above script?
(By the way, when you try to see the object hierarchy for the links in the search results the Object Spy does not show a Webtable to be part of that hierarchy.)
Thanks,
Neeraj