ClickLinkWithText
Description:
Click a Link on the current Document that has Text matching the specified Text.
Format:
ClickLinkWithText (integer Session ID (optional), string Text, integer Occurrence (optional))
|
Parameters: |
Integer |
Session ID (optional) |
Browser Occurrence Number.
First Browser occurrence is 1
Default value is 1 |
|
String |
Text |
Text displayed on the Link.
Wildcards ('*') are allowed |
|
Integer |
Occurrence (optional) |
Link Occurrence Number.
First Link occurrence is 1
Default value is 1 |
|
Return Value: |
Boolean |
Success Ind |
Success Indicator.
TRUE – Link was clicked
FALSE – Link was not clicked |
Usage:
Use this function to click on a Link displaying the specified Text on the current Document. Text is what is displayed on the Link not the internal HTML Name. Wildcards can be specified in the Text string to match on partial displayed Text on the Link. The wildcard character is the asterisk ('*') and can be used on the beginning and/or end of the Text string. Use the optional Link Occurrence Number when more than one Link on the Document matches the Text string. Matches are not Case Sensitive.
Example 1:
Click on a Link that displays the word 'Home'.
ClickLinkWithText ('Home')
Example 2:
Click on the second Link that displays the word 'Product'.
ClickLinkWithText ('Product', 2)
Example 3:
Click on the second Link that displays the word 'Open' anywhere on the Link text.
ClickLinkWithText ('*Open*', 2)
Example 4:
Click on the third Link that displays the word 'Open' at the beginning of the Link text in the second occurrence of the Browser.
ClickLinkWithText (2, 'Open*', 3)
Example 5:
Click each Link on a Document that displays the words 'Details'. This example assumes that the clicked Link navigates to another Document and the GoBackDocument function is used to return to the original document before clicking on the next Link.
integer intLinkNum
intLinkNum = 1
While ClickLinkWithText ('Details', intLinkNum)
GoBackDocument()
intLinkNum = intLinkNum + 1
EndWhile