Forum Discussion

stevereissps's avatar
stevereissps
Occasional Contributor
5 years ago

Running 2 Instances on Same Machine?

Hi All!   We are in need of running 2 instances of our Java based app at the same time on SAME MACHINE - to simulate a multi-user situation.   User1 - Would start the app - and start a long proce...
  • AlexKaras's avatar
    5 years ago

    Hi,

     

    TestComplete "gets confused" at which window to work on

    In a nutshell, you need to examine both application processes in the Object Browser and figure out the properties that in combination allow to uniquely distinguish these two applications. (For example, these might be process name and its index. (Though index is usually not stable))

    Then you should use these properties to get a reference to the proper application.

    Sample untested pseudo-code:

    var app1 = Sys.FindChild(["ProcessName", "Index"], ["JavaApp", 1], 0);

    var app2 = Sys.FindChild(["ProcessName", "Index"], ["JavaApp", 2], 0);

    app1.MainForm.Button("StartLengthyProcess").Click();

    aqUtils.Delay(2000, "Some delay to let lengthy process to start");

    app2.MainForm.Button("StopLengthyProcess").Click();