BrowserNativeClick function clicks a DOM element with a specified position and mouse button. For example, buttons are clicked, links lead to navigation, and  left-button clicks execute the default actions of the clicked element types. 
 
In contrast to the BrowserClick function, the BrowserNativeClick function uses Windows API level events to simulate the mouse events instead of JavaScript events.  The BrowserNativeClick function is not recorded.  It must be scripted manually. 

Include file: BrowserAPI.bdh 
 
Syntax
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 : X position relative to the top left corner of the DOM element. Defaults to the middle of the DOM element.  
nY : Y position relative to the top left corner of the DOM element. Defaults to the middle of the DOM element.  
nButton : 1 or BUTTON_LEFT to use the left mouse button (default), 2 or BUTTON_RIGHT to use the right mouse button. 
sTimer : Optional: Name of the timer used for page measurements. If this parameter is omitted, no measurements are performed. 
 
Return value
true if successful 
false otherwise 
 
 
Example of use:
 
transaction TBrowserNativeClickDemo
begin
  ...
  // left click in the middle of a dom element
  BrowserNativeClick("//div[@innerText='menu']");
  // right click on a dom element on relative position (10/20) that might open up a menu via javascript
  BrowserNativeClick("//div[@innerText='menu']", 10, 20, BUTTON_RIGHT);

end TBrowserNativeClickDemo;

Video