This function is useful for custom synchronization. It can be used to wait until a property has a certain value. As soon as the property has the specified value, the function returns. When the timeout is reached, an error is thrown.
BrowserAPI.bdh
BrowserWaitForProperty( uTestObject : in union,
sDomPropertyName : in string,
vDomPropertyValue : in union,
nTimeout : in union optional ): boolean;
| Parameter | Description |
|---|---|
| uTestObject | The XPath locator or the handle to the DOM element. |
| sDomPropertyName | The DOM property name. |
| vDomPropertyValue | The value to be waited for. |
| nTimeout | Optional: The wait timeout in milliseconds. If not specified, the default timeout specified in the profile settings or set by BrowserSetOption(BROWSER_OPT_WAIT_TIMEOUT) will be used. When the timeout is reached, an error is thrown. Use the data type number for this parameter. The data type float is not allowed. |
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);
// wait for dom element to alter checked state (should be checked after 2.5 seconds)
BrowserNavigate("http://demo.borland.com/TestSite/JavaScriptDisappear.html");
BrowserWaitForProperty("//INPUT[@id='ToChange']", "checked", true);
end TMain;