CanResume Method

Applies to TestComplete 14.20, last modified on September 11, 2019
The manual testing functionality is deprecated. Do not use it for creating new tests. It will be removed in a future TestComplete release.

Description

The CanResume method checks whether a manual test was suspended earlier and whether it can be resumed.

Declaration

ManualTestingObj.CanResume()

ManualTestingObj An expression, variable or parameter that specifies a reference to a ManualTesting object
Result Boolean

Applies To

The method is applied to the following object:

Result Value

The method returns True if the test has information about the state of the previously suspended run. Otherwise, the method returns False.

Example

The following code snippet starts executing a manual test. If the test is suspended during the execution, it suggests resuming the testing.

JavaScript, JScript

function Main()
{
  // Clears the resume information
  ManualTests.NewManualTest.ClearResumeInfo();
  // Starts the manual testing
  ManualTests.NewManualTest.Start();

  ...

  while (ManualTests.NewManualTest.CanResume())
  {
    var btnset = mkSet(mbYes, mbNo);
    // Confirms whether to resume the manual testing
    var res = MessageDlg("Manual Testing has been suspended. Resume?", mtConfirmation, btnset, 0);
    if (res == 6)
      // Resumes the manual testing
      ManualTests.NewManualTest.Resume(true);
    else
    {
      Log.Message("You can resume the manual testing later");
      break;
    }
  }

}

Python

def Main():
  # Clears the resume information
  ManualTests.NewManualTest.ClearResumeInfo()
  # Starts the manual testing
  ManualTests.NewManualTest.Start()
  while ManualTests.NewManualTest.CanResume():
    btnset = mkSet(mbYes, mbNo)
    # Confirms whether to resume the manual testing
    res = MessageDlg("Manual Testing has been suspended. Resume?", mtConfirmation, btnset, 0)
    if res == 6:
      # Resumes the manual testing
      ManualTests.NewManualTest.Resume(True)
    else:
      Log.Message("You can resume the manual testing later")
      break

VBScript

Sub Main

  ' Clears the resume information
  ManualTests.NewManualTest.ClearResumeInfo
  ' Starts the manual testing
  ManualTests.NewManualTest.Start

  ...

  Do While ManualTests.NewManualTest.CanResume
    btnset = mkSet(mbYes, mbNo)
    ' Confirms whether to resume the manual testing
    res = MessageDlg("Manual Testing has been suspended. Resume?", mtConfirmation, btnset, 0)
    If res = 6 Then
      ' Resumes the manual testing
      ManualTests.NewManualTest.Resume(True)
    Else
      Log.Message "You can resume the manual testing later"
      Exit Do
    End If
  Loop

End Sub

DelphiScript

procedure Main();
var btnset, res;
begin
  // Clears the resume information
  ManualTests.NewManualTest.ClearResumeInfo;
  // Starts the manual testing
  ManualTests.NewManualTest.Start;

  ...

  while ManualTests.NewManualTest.CanResume do
  begin
    btnset := mkSet(mbYes, mbNo);
    // Confirms whether to resume the manual testing
    res := MessageDlg('Manual Testing has been suspended. Resume?', mtConfirmation, btnset, 0);
    if res = 6 then
      // Resumes the manual testing
      ManualTests.NewManualTest.Resume(true)
    else
    begin
      Log.Message('You can resume the manual testing later');
      break;
    end;
  end;

end;

C++Script, C#Script

function Main()
{
  // Clears the resume information
  ManualTests["NewManualTest"]["ClearResumeInfo"]();
  // Starts the manual testing
  ManualTests["NewManualTest"]["Start"]();

  ...

  while (ManualTests["NewManualTest"]["CanResume"]())
  {
    var btnset = mkSet(mbYes, mbNo);
    // Confirms whether to resume the manual testing
    var res = MessageDlg("Manual Testing has been suspended. Resume?", mtConfirmation, btnset, 0);
    if (res == 6)
      // Resumes the manual testing
      ManualTests["NewManualTest"]["Resume"](true);
    else
    {
      Log["Message"]("You can resume the manual testing later");
      break;
    }
  }

}

See Also

Suspend Method
Resume Method
Executing Manual Tests

Highlight search results