ITester Methods
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 = ""
)
Parameter | Description |
name | Type: String Name of the variable to return. Casing does not matter. |
[defaultValue] | Type: String Value to return if the variable is not found or defined. |
Return Value:
Content of the variable defined by name or defaultValue if the variable name is not found.
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.
Writes information to the public execution log.
Syntax:
bool Log(
string content
)
Parameter | Description |
content | Information to write to the execution log |
Syntax:
void PopLogScope();
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:
Logging code
Produced log
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(); }
}
0000002890,[STEP 1]:MyScreen.MyMethod()
0000002894,[STEP 1]:[MyScreen.MyMethod]:A log from DoSomething
0000002899,[STEP 1]:[MyScreen.MyMethod]:Something else that was logged in MyMethod
0000020101,[STEP 1]:Something that was logged after MyMethod returned
Syntax:
void PushLogScope(
string logScope
);
Parameter | Description |
logScope | Type: string Name of the new log scope, often given as ClassName.MethodName |
Tries to copy the requested filetype from the TestResults.io portal storage to the remote directory that holds the supporting files.
Usage:
Without autoExpand
With autoExpad
t.RequestFile(RequestableFileTypeEnum.SoftwareExecutable, out string zipName, false);
SystemHelpers.UnzipFile(SystemHelpers.InstallerDirectory + zipName, installationDir
t.RequestFile(RequestableFileTypeEnum.SoftwareExecutable, out _, true);
SystemHelpers.CopyFile(SystemHelpers.InstallerDirectory + "myFileNameInArchive", targetDir);
Syntax:
bool RequestFile(
RequestableFileTypeEnum requestedFile,
out string outputName,
bool autoExpand = false
)
Parameter | Description |
requestedFile | Type: RequestableFileTypeEnum Filetype to copy to the supporting files remote directory (currently only supports SoftwareExecutable) |
outputName | Type: string Name under which the requested file will be available in the remote directory (relative to the RequestedContent subdirectory). This is especially relevant |
[autoExpand] | Type: bool Specifies if the file should be expanded if required (e.g. a zip file). Default false |
Return Value:
True if the file could be downloaded, false otherwise.
Waits for the defined amount of seconds
Syntax:
void Wait(
double seconds
)
Parameter | Description |
seconds | Type: Double Amount to wait for in second, e.g. half a second can be represented by 0.5 |
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()
Blocks the execution of the current step until the manual interaction is confirmed
Syntax:
void WaitForManualInteraction(
string messageToShow
)
Parameter | Description |
messageToShow | Type: String Message to show to the user |
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
)
Parameter | Description |
[maxRequestIntervallTimeInMinutes] | Type: Double Specifies the maximum wait time until the method queries the API for a start time. A start time will only returned after all test cases have queried the API at least once. Default 5. |
[maximumWaitTimeInMinutes] | Type: Double Specifics the maximum time the method waits until it gets an allowed execution start time. The maxmiumWaitTimeInMinutes is only checked until an execution start time was received from the API. Once the time was received the method does not abort anymore. Default 60. |
Last modified 3yr ago