Forum Discussion

AAS's avatar
AAS
Occasional Contributor
6 years ago
Solved

Access the tested application from a SDK program object

Hello,

 

Following the SDK help file, I have successfully created a program object that does basic operations.

However, what I'm interested in is to interact with the currently tested application, by doing the following two things:

  1. Read the exe file resources
  2. Call methods within the executing application

How can I achieve this? I tried looking for managers to get through the Managers collection, but I could not find anything obvious in here.

 

Any help is appreciated.

 

Regards

  • That "code" is the mapping of the process object as stored in the NameMapping node of the project.  NameMapping is the primary means by which TestComplete identifies objects.  It is primarily for identifying UI components for interactions and property checks.  It doesn't store the EXE location for Aliases.MyVCLApp.  HOWEVER, once you run the app, if you check Aliases.MyVCLApp.Path, that should return the EXE location... but note, that the app needs to be started first.

6 Replies

  • AAS's avatar
    AAS
    Occasional Contributor

    Well, doing this is feasible with DLL injection into the target application.

    But I'm still missing the essential part, that is how can I get the full exe name of the application currently under test?

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I don't know much about the SDK.  But there is, generally, not a "hook" that says "This is the application under test".  TestComplete automation can interact with multiple EXE and services during the course of testing an application.  So, how do you define "Application Under Test"?  It seems that the better solution would be to have some sort of configuration or option to set within your plug in to indicate "this is the exe for the application under test" rather than having TestComplete try and figure it out.

      • AAS's avatar
        AAS
        Occasional Contributor

        Yes, I understand that.

        But when I record a script, there is code created that accesses the application and interacts with it. Something like this:

        Aliases.MyVCLApp.SomeForm.btnNew.Click(61, 12);

        But I can't seem to find any properties on the alias that gives me the location of the process. I'll have to check CommandLine, but it sounds to me as if it contains only the arguments.