cancel
Showing results for 
Search instead for 
Did you mean: 

Switch between copies of same applicaton

SOLVED
Contributor

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Switch between copies of same applicaton

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);
.................................................

View solution in original post

5 REPLIES 5
Contributor

Re: Switch between copies of same applicaton

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;

Community Hero

Re: Switch between copies of same applicaton

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.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Switch between copies of same applicaton

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.....

Contributor

Re: Switch between copies of same applicaton

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);
.................................................

View solution in original post

Community Hero

Re: Switch between copies of same applicaton

The thing about that arrangement is that it is still sequential.  It's not a really good "stress test" scenario because

 

a) You're using resources on the same PC/CPU and so it's going to be tricky to know what is stress on the application and what is stress on the PC

b) There isn't really concurrency happening which is key to stress testing.  The more concurrent actions, the more stress.  You're still executing things in sequence so it's waiting for one thing to be done before it goes on to the next.

 

Suggestion:

 

Rather than running 3 instances on the same workstation, if you have TestComplete/TestExecute licenses enough, you can look into doing distributed testing to get that concurrency factor.

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/distributed/


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
New Here?
Join us and watch the welcome video:
Watch the new Interview