Forum Discussion

Leahy's avatar
Leahy
Contributor
5 years ago
Solved

Switch between copies of same applicaton

Hi ,

 

I have opened multiple cases of the same applicaton with:

TestedApps.hastus1.Run(3);

I am having trouble finding a way to switch between the separate instances...

 

Is there a simple way ?

  • Got it to work...

     

    // # 1. Start 3rd Hastus
    TestedApps.hastus1.Run(3);


    var p = Sys.Process("hastus",1);
    var q = Sys.Process("hastus",2);
    var r = Sys.Process("hastus",3);

    // open dcsc03 in instance 3
    var Item = r.window("*","hdo01 - DAILYTEST2016*");
    Item.Activate();
    let hastus = Aliases.hastus;
    hastus.Form.WIN_FORMMENUSTRIP.Daily.Click(18, 9);
    let toolStripDropDownMenu = hastus.ToolStripDropDownMenu;
    .....................................


    // open emp01 in instance 2
    var Item = q.window("*","hdo01 - DAILYTEST2016*");
    Item.Activate();
    hastus.Form.WIN_FORMMENUSTRIP.Employees.Click(45, 8);
    .................................................

5 Replies

  • Leahy's avatar
    Leahy
    Contributor

    I am getting there...I now have the process ID's..

     

    TestedApps.hastus1.Run(3);

     

    TestObj1 = Sys.Process("hastus",1);
    TestObj2 = Sys.Process("hastus",2);
    TestObj3 = Sys.Process("hastus",3);

    var first = TestObj1.Processid;
    var second = TestObj2.Processid;
    var third = TestObj3.Processid;

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      That seems like it will work. The only thing I anticipate problems with is child object identification, especially if you're going to be using NameMapping. 

       

      Can I ask... what's the purpose/testing requirement of needing 3 copies open at the same time?  There may be other ways of testing via automation that might not require this.

      • Leahy's avatar
        Leahy
        Contributor

        Hello Robert,

         I plan to have multiple copies running to do stress tests.  I want to open forms on each, fill in boxes and save.  Meanwhile watching/tracking system resources and response times...

         

        I still have not got the script to switch between copies and open forms on each one.....