ITester Methods

GetVariable

Returns the content of a variable as a string. If the variable is not defined the defaultValue is returned. The variables can be defined in the portal either under the test plan or the software version.

Syntax:

string GetVariable(
	string name,
	string defaultValue = ""
)

Return Value: Content of the variable defined by name or defaultValue if the variable name is not found.

IsVersion

Checks if the current TR.IO Framework fullfills the required version constraints.

Syntax:

bool IsVersion(
    Version minVersion = null,
    Version maxVersion = null
)

Return Value: True if the constraints are fullfilled, false otherwise.

Log

Writes information to the public execution log.

Syntax:

bool Log(
    string content
)

PopLogScope

Removes the last log scope from the stack. See below under PushLogScope for details of usage.

Syntax:

void PopLogScope();

PushLogScope

Pushes a new scope to the current log scope stack. Every log entry will be started with all currently pushed scopes in the front of it. Log scopes are only valid within a single step and will be automatically removed after a step finished. If you want to use different scopes in the same step, each PushLogScope should be matched by a corresponding PopLogScope. Example for usage:

public void MyMethod()
{
    t.Log("MyScreen.MyMethod()");
    t.PushLogScope("MyScreen.MyMethod");
    try
    {
        // everything in this block will be logged with the scope MyScreen.MyMethod
        DoSomething();
        return;
    }
    finally { t.PopLogScope(); }
}

Syntax:

void PushLogScope(
    string logScope
);

RequestFile

Tries to copy the requested filetype from the TestResults.io portal storage to the remote directory that holds the supporting files. Usage:

t.RequestFile(RequestableFileTypeEnum.SoftwareExecutable, out string zipName, false);
SystemHelpers.UnzipFile(SystemHelpers.InstallerDirectory + zipName, installationDir

Syntax:

bool RequestFile(
    RequestableFileTypeEnum requestedFile,
    out string outputName,
    bool autoExpand = false
)

Return Value: True if the file could be downloaded, false otherwise.

Wait

Waits for the defined amount of seconds

Syntax:

void Wait(
	double seconds
)

WaitForInteractionTimeout

Waits for the specified interaction timeout (GeneralInteractionWaitTime) in case the last operation was an interaction and the time between the last interaction and this call is less than the specified timeout. This is done automatically for "high-level" actions on ITestee such as Mouse.Click or Keyboard.Type, but not for all "low-level" actions such as Keyboard.Down.

Syntax:

void WaitForInteractionTimeout()

WaitForManualInteraction

Blocks the execution of the current step until the manual interaction is confirmed

Syntax:

void WaitForManualInteraction(
	string messageToShow
)

WaitForParallelTestCasesToBeAvailable

For performance tests only. Stops the execution of the test case until all other test case instances are ready to be executed simultaneously.

Syntax:

void WaitForParallelTestCasesToBeAvailable(
	double maxRequestIntervallTimeInMinutes = 5,
	double maximumWaitTimeInMinutes = 60
)

Last updated