BrowserTtiIncludeElement Function

Action

Marks an element as relevant for measuring the Time to Interact. A subsequent API call such as BrowserNavigate or BrowserClick starts the actual measurement. You can define any number of TTI elements. The browser waits until all specified TTI elements are found. The slowest element determines the Time to Interact; this value is stored in the results. Furthermore, if TrueLog creation is enabled, additional information about each TTI element is presented in the Truelog file.

Include file

BrowserAPI.bdh

Syntax

BrowserTtiIncludeElement( uTestObject : in union );
Parameter Description
uTestObject The XPath locator or the handle to the DOM element.

Return value

  • none

Example

benchmark SilkPerformerRecorder

use "BrowserAPI.bdh"

dcluser
  user
    VUser
  transactions
    TMain           : 1;

dcltrans
  // When navigating to the test site (see 'BrowserNavigate' function below), a download link is created after a few seconds.
  // We can interact with the page only after this download link has appeared.
  // Therefore we define this download link as a TTI element.
  transaction TMain
  begin
    BrowserStart(BROWSER_MODE_DEFAULT, 800, 600);
    BrowserReplayCompatibility(SP_15_5);

    // Mark the download link as TTI element:
    BrowserTtiIncludeElement("//a[@textContents='DOWNLOAD PDF NOW']");
    // Navigate with TTI measurement enabled.
    // The following call will be blocked until the download link appears.
    BrowserNavigate("http://demo.borland.com/testsite/download_appear.html", "Measure_Time_To_Interact");

    // Navigate without TTI measurement.
    // This navigation will finish almost immediately.
    BrowserNavigate("http://demo.borland.com/testsite/download_appear.html", "Measure_Navigation");
  end TMain;