StLoadProject Function

Action

The StLoadProject function instructs Silk Test to load a Silk Test package file. Only packages can be loaded. When a package is being added to Silk Performer data files, you do not have to use an absolute path. In addition to loading the package, some basic Silk Test settings are set with this function.

Include file

StAutomation.bdh

Syntax

StLoadProject( in sProject : string): boolean;

Return value

  • true if all settings have been set successfully and the package can be loaded by Silk Test

  • false otherwise

Parameter Description
sProject The path to the Silk Test package file. An absolute or a relative path can be provided. However, if the path is relative, the package must be added to the data files.

Example

transaction TMain
var
  sUser     : string;
  sPassword : string;
begin
  AttributeGetString("Username", sUser);
  AttributeGetString("Password", sPassword);
  if (StInitSession(sUser, sPassword)) then
    StLoadProject("package.stp");
    StSetOption(ST_OPTION_TRUELOG_OPTIONS,ST_TRUELOG_ALL);
    StExecuteTestcase("scriptFile.t", "testcase", "\" testdata\",10", "MyTimer1");
    StLogoffSession();
  end;
end TMain;