BrowserLinkSelect Function

Action

Clicks a DOM link. A DOM link represents all DOM elements that were specified using the <A> tag.

注: This function performs the same action as BrowserClick.

Include file

BrowserAPI.bdh

Syntax

BrowserLinkSelect( uTestObject : in union,
                   sTimer      : in string optional ): boolean;
Parameter Description
uTestObject The XPath locator or the handle to the Link.
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

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
  var
    wnd1   : number;
    wnd2   : number;
    check1 : number;
  begin
    BrowserStart(BROWSER_MODE_DEFAULT, 800, 600);    
    BrowserNavigate("http://demo.borland.com/TestSite/multiplewindows/multipleWindows.html");
    wnd1 := BrowserGetActiveWindow("mainWindow");
    BrowserLinkSelect("//A[@name='window1']",  "Select, BODY (#1)");
    wnd2 := BrowserGetActiveWindow("first window");
    BrowserActivateWindow(wnd1);
    BrowserLinkSelect("//A[@name='window2']",  "Select, BODY (#1)");
    
    BrowserCloseWindow(wnd2); // close second window (tab)
    BrowserCloseWindow();     // close active window (tab)
  end TMain;