Description
The Pause
method is an analogue to breakpoints in keyword tests and scripts. It allows you to pause the test execution on the keyword test operation or script line that follows the method call. The “stop” line is highlighted as if it contains a breakpoint. You can use the pause to evaluate variables and expressions, explore the call stack and perform other actions. You can then continue the debugging by stepping through your test, or press to continue the test run.
To call the method from a keyword test, use the Run Code Snippet or Call Object Method operations.
Declaration
Runner.Pause()
Result | None |
Applies To
The method is applied to the following object:
Result Value
None.
Remarks
The Pause
method will not stop the test execution, if the Enable Debugging button on the Test Engine toolbar is not pressed.
The method also does not perform any actions if the project is executed in TestExecute or if TestComplete was opened in Silent mode.
Example
The following example demonstrates how to use the Runner.Pause
method to pause the test execution and enable the debugging mode.
JavaScript, JScript
function Test()
{
// Launches the tested application and performs testing actions
TestedApps.SampleApp.Run();
…
// Pauses testing and activates step-by-step debugging
Runner.Pause();
// Performs testing actions
…
}
Python
def Test():
# Launches the tested application and performs testing actions
TestedApps.SampleApp.Run()
# ...
# Pauses testing and activates step-by-step debugging
Runner.Pause()
# Performs testing actions
# ...
VBScript
Sub Test
' Launches the tested application and performs testing actions
TestedApps.SampleApp.Run
…
' Pauses testing and activates step-by-step debugging
Runner.Pause
' Performs testing actions
…
End Sub
DelphiScript
procedure Test();
begin
// Launches the tested application and performs testing actions
TestedApps.SampleApp.Run;
…
// Pauses testing and activates step-by-step debugging
Runner.Pause;
// Performs testing actions
…
end;
C++Script, C#Script
function Test()
{
// Launches the tested application and performs testing actions
TestedApps["SampleApp"]["Run"]();
…
// Pauses testing and activates step-by-step debugging
Runner["Pause"]();
// Performs testing actions
…
}
See Also
Activating Debugger From Tests
Debugging Tests
Debugging Tests - Overview