Clicks a DOM element with a specified position and mouse button. A left-button click executes the default actions of the clicked element type.
BrowserAPI.bdh
BrowserNativeClick( uTestObject : in union,
nX : in number optional,
nY : in number optional,
nButton : in number optional,
sTimer : in string optional ): boolean;
| Parameter | Description |
|---|---|
| uTestObject | Either a locator that identifies the DOM element or a handle to a previously found DOM element. Throws an error if an invalid handle is used or if the locator can not be resolved. |
| nX | Optional: X position relative to the top left corner of the DOM element. Defaults to the middle of the DOM element. If the middle of the DOM element cannot be clicked, which can be the case when another element is placed in front of it, a different position will be used. If no such position can be found, a legacy click function will be used instead. |
| nY | Optional: Y position relative to the top left corner of the DOM element. Defaults to the middle of the DOM element. If the middle of the DOM element cannot be clicked, which can be the case when another element is placed in front of it, a different position will be used. If no such position can be found, a legacy click function will be used instead. |
| nButton | Optional: BUTTON_LEFT to use the left mouse button (default), BUTTON_RIGHT to use the right mouse button. You can combine mouse buttons with modifier keys using an OR operator. Specify MODIFIER_SHIFT, MODIFIER_ALT, or MODIFIER_CTRL for the respective modifier key. For example: BUTTON LEFT | MODIFIER_CTRL |
| sTimer | Optional: Name of the timer used for page measurements. If this parameter is omitted, no measurements are performed. |
true if successful
false otherwise
benchmark SilkPerformerRecorder
use "Kernel.bdh"
use "BrowserAPI.bdh"
dcluser
user
VUser
transactions
TInit : begin;
TMain : 1;
var
dclrand
dcltrans
transaction TInit
begin
end TInit;
transaction TMain
begin
BrowserStart(BROWSER_MODE_DEFAULT, 800, 600);
BrowserNavigate("http://demo.borland.com/TestSite/gwt/Showcase.html#CwBasicButton");
// store the button press action to perform when if the dialog with the given name pops up during replay
BrowserDlgSetButton("Message from webpage #1", "OK");
// click the button to make the dialog pop up
BrowserNativeClick("//BUTTON[@textContents='Normal Button']", 5, 5, BUTTON_Left);
// clear the dialog command storage
BrowserDlgStop();
end TMain;