Is it possible to call ToolsAPI from code in a DUnit GUITestrunner?

Is there a way to initialize the global variable BorlandIDEServices in the ToolSAPI module so that it can be used from the DUnit GUITestrunner code?

procedure TGUITestRunner.FailureListViewClick(Sender: TObject);
var
  Project: IOTAProject;
begin
  if FailureListView.Selected <> nil then
  begin
    TestTree.Selected := TTreeNode(FailureListView.Selected.data);

    // call OTA
    Project := ToolsAPI.GetActiveProject;
    ShowMessage(Project.ProjectType);

  end;
end;

In this example, the Project variable will be nil because the BorlandIDEServices variable is not initialized. GUITestrunner starts from the IDE in debug mode.

+5
source share
2 answers

, BorlandIDEServices , ( ) IDE. ; IDE, , , ToolsAPI.

, GExperts, IDE , ToolsAPI. GUITestRunner; , .

+4

, ( ), OTA, GUITestrunner .

, " " SomeTests.pas " " GUITestrunner.

+2

All Articles