The SystemLibrary collection contains user code methods that provide useful system-level functionality. You use these methods to kill processes, handle date/time strings, and measure execution duration within your recordings.
SystemLibrary methods
To use these methods, add them to your desired recording module. For more information, see Using the User Code Library.
KillProcess
Terminates a running process. String processname is the name of the process to kill as displayed in the Windows Task Manager.
GetDateTimeAsString
Returns the current date and time as a string. String expectedFormat defines the format of the returned string. It uses the placeholders d = day, M = month, y = year, h = hour, m = minute, s = second.
If left empty, the application uses the format currently set in Windows.
StartTimer
Starts a timer to measure an interval.
- String expectedFormat defines the format of the returned string. Uses standard placeholders (d = day, M = month, y = year, h = hour, m = minute, s = second).
- String timerName defines a custom name for the timer. You can have several timers running at once.
StopTimer
Stops a specific timer and logs the elapsed time to the Ranorex Report. timerName specifies the name of the timer to stop.