Forum Discussion

CBleunven's avatar
CBleunven
Contributor
12 years ago

2 instances of the application running - adressing the right windows

Hi,

I'm facing a problem with building a test with Test Complete.

We may run several instances of our applications in the same time. Processes appears under the Object browser as ["Process"]("Name"), ["Process"]("Name",2) etc... So they differ asexpected by an index.

But below windows carry the same name:

["VCLObject"]("TConfig0") and the same MappedName.

Thus when trying to act on the second window, it is always the first window wich is adressed.



Is there a way to manage this, in KeywordTests or with script tests ?

I've no problem to pick the good process but I can't retrieve the windows from it.

The following script fails

var p,w;

 p = Sys["Process"]("Name")["_NewEnum"];

 w = p["VCLObject"]("TObjectAliase0");  // error: Object expected




Many thanks for your help.

Have nice tests,

Christophe

3 Replies

  • Hi,



    If there are multiple instances open, you should know on which one you want to perform the action. That you can capture using index.

     p = Sys["Process"]("Name",1 or 2 or indexnumber)



    i guess this is what you are looking.



    regards,

    Saurabh
  • the error was in the previous instruction: ["_NewEnum"] that was not necessary...



    Nevertheless I'm interested if there is a way to adress my question using KeywordTests.



    thanks for help,

    Christophe
  • Hi Saurabh,

    thank you for your reply.

    It now works perfect !

    And as script are really more convenient for low level actions, I will pursue on this way.



    Christophe