ClickButtonWithText

Description:
Click a Button on the current Document that has Text matching the specified Text.

Format:
ClickButtonWithText (integer Session ID (optional), string Text, integer Occurence (optional))

Parameters:

integer

Session ID (optional)

Browser Occurrence Number.
First Browser occurrence is 1
Default value is 1

string

Text

Text displayed on the Button.
Wildcards ('*') are allowed

integer

Occurrence (optional)

Button Occurrence Number.
First Button occurrence is 1
Default value is 1

Return Value:

boolean

Success Ind

Success Indicator.
TRUE – Button was clicked
FALSE – Button was not clicked

Usage:
Use this function to click on a Button displaying the specified Text on the current Document. Text is what is displayed on the Button not the internal HTML Name. Wildcards can be specified in the Text string to match on partial displayed Text on the Button. The wildcard character is the asterisk ('*') and can be used on the beginning and/or end of the Text string. Use the optional Occurrence Number when more than one Button on the Document matches the Text string. Matches are not Case Sensitive.

Example 1:
Click on a Button that displays the word 'Search'.

ClickButtonWithText ('Search')

Example 2:
Click on the second Button that displays the word 'Search'.

ClickButtonWithText ('Search', 2)

Example 3:
Click on the second Button that displays the word 'Open' anywhere on the Button text.

ClickButtonWithText ('*Open*', 2)

Example 4:
Click on the third Button that displays the word 'Open' at the beginning of the Button text in the second occurrence of the Browser.

ClickButtonWithText (2, 'Open*', 3)

Example 5:
Click each Button on a Document that displays the words 'Add to Cart'. This example assumes that the clicked Button navigates to another Document and the GoBackDocument function is used to return to the original document before clicking on the next Button.

integer intButtonNum

intButtonNum = 1
While ClickButtonWithText ('Add to Cart', intButtonNum)
	GoBackDocument()
	intButtonNum = intButtonNum + 1
EndWhile
Hosted by www.Geocities.ws

1