sub ClickLink {#$LinkName, $popup,$CheckForMessageBox, $Index,$nowait
Description: Clicks on a
Link
How To:
Just look at the text of the link on the page:
Example:
<p><a href="http://sourceforge.net/projects/samie">Simple
Automated
Module For Internet Explorer</a><br>
<br>
</p>
ClickLink("Simple Automated Module For Internet Explorer");
If $CheckForMessageBox is set to 1 samie is supposed to Verify a messagebox, but I think that's stubbed out in the latest build for now.
Use $Index if there are links on the same page or frame with the
exact same text.
Cookbook recipe
use Win32::OLE;
use Win32::SAM; #use Win32::Slingshot;
$| = 1;
my $URL = "http://samie.sourceforge.net/ClickLinkTest.html";
my $seconds;
$Win32::OLE::Warn = 3;
StartIE();
$seconds = Navigate($URL);
print "Checkbox.html page took $seconds seconds to load\n";
$seconds = ClickLink("test link below");
print "testlink.html took $seconds seconds to load\n";Further Notes:
The second parameter $popup is optional.
It tells samie that the FormButton is going to raise a popup window.
The third parameter $CheckForMessageBox is optional.
It tells samie that a message box will appear when this button is clicked.
With this paramter set to 1 samie will resume the process to react to the message box.
This process must first be started with a call to VerifyMessageBox.The fourth parameter $Index is optional. It is used when there is more than one link with the same $LinkName.
The fifth parameter $nowwait is optional. It is used when you don't want samie to call WaitForDocumentComplete
or WaitForDocumentCompleteForPopup after you click the button.