BrowserCheckBoxSelect Function

Action

Sets the state of a check box.

Include file

BrowserAPI.bdh

Syntax

BrowserCheckBoxSelect( uTestObject : in union,
                       nState      : in number,
                       sTimer      : in string optional ): boolean;
Parameter Description
uTestObject Either a locator that identifies the check box or a handle to a previously found check box. Throws an error if an invalid handle is used or if the locator can not be resolved.
nState Use CHECKBOX_CHECKED to check the check box or CHECKBOX_UNCHECKED to uncheck the checkbox. Other values will raise an error.
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
  begin
    BrowserStart(BROWSER_MODE_DEFAULT, 800, 600);
    BrowserNavigate("http://demo.borland.com/TestSite/gwt/Showcase.html#CwCheckBox");
      
    // check Monday
    BrowserCheckBoxSelect("//SPAN[@hideFocus='0']/INPUT[@hideFocus='0']", CHECKBOX_CHECKED);
    // uncheck Monday
    BrowserCheckBoxSelect("//SPAN[@hideFocus='0'][1]/INPUT[@hideFocus='0']", CHECKBOX_UNCHECKED);
    // check Tuesday
    BrowserCheckBoxSelect("//SPAN[@hideFocus='0'][2]/INPUT[@hideFocus='0']", CHECKBOX_CHECKED);

    BrowserStop();
  end TMain;