working with multiple AUTs using jubula java api [message #1706713] |
Sat, 29 August 2015 00:06  |
Eclipse User |
|
|
|
Hi,
i am trying to launch two applications using jubula in java and work between them.
these are the steps i follow
> start the aut agent
> launch app1 (takes more time to launch)
> hence wait for a home button to appear
>click on that button
>launch app2
>click on a button in app2
all the steps run fine except the last. I get the exception org.eclipse.jubula.client.exceptions.ComponentNotFoundException
i believe the AUT agent is still looking for the component with first application.
I tried disconnecting the first aut also using two autagents (60001 and 60000) for each application. but something is stopping to create two separate threads
below is the code i use.
Any input would be of great help.
AUTAgent autagent = MakeR.createAUTAgent("localhost",60001);
autagent.connect();
AUT RAUT = null;
AUT SAUT = null;
ComponentIdentifier CC;
ButtonComponent Button;
AUTConfiguration autconfigurationR = new SwingAUTConfiguration("R",
"R",
"runlocal.bat",
"C:\\POSrewrite",
null,
Locale.getDefault());
AUTConfiguration autconfigurationS = new SwingAUTConfiguration("S",
"S",
"runsimulator.bat",
"C:\\POSrewrite",
null,
Locale.getDefault());
AUTIdentifier R = autagent.startAUT(autconfigurationR);
if(R!=null){
RAUT = autagent.getAUT(R, SwingComponents.getToolkitInformation());
RAUT.connect();
}else{
System.out.println("AUT start has failed");
}
CC = OM.objectMapping.get("btnSales");
Button = SwingComponents.createAbstractButton(CC);
boolean proceed = false;
while(!proceed){
try{
RAUT.execute(Button.checkExistence(true), "jubula");
proceed = true;
}
catch(Exception e){
proceed = false;
}
}
Thread.sleep(5000);
RAUT.execute(Button.click(1,InteractionMode.primary), "jubula");
AUTIdentifier S = autagent.startAUT(autconfigurationS);
if(S!=null){
SAUT = autagent.getAUT(S, SwingComponents.getToolkitInformation());
SAUT.connect();
}else{
System.out.println("AUT start has failed");
}
CC = OM.objectMapping.get("btnPrint");
Button = SwingComponents.createAbstractButton(CC);
Thread.sleep(10000);
SAUT.execute(Button.click(1,InteractionMode.primary), "jubula");
RAUT.disconnect();
SAUT.disconnect();
autagent.disconnect();
System.out.println("Done");
Thanks
Geetha
|
|
|
|
|
|
Re: working with multiple AUTs using jubula java api [message #1765527 is a reply to message #1765422] |
Mon, 12 June 2017 02:44  |
Eclipse User |
|
|
|
Hi Geetha and Samed
Jubula does not support testing multiple AUTs from a single JVM. The best you can do is to continuously connect - disconnect to the relevant AUT, but you must also activate it in this case by clicking inside its window (if the other AUT's window covers it, then other AUT-internal methods may be needed, e.g. for minimizing the other, or activating the current AUT). Note that connecting to an AUT is fairly time-consuming, so this approach has its own drawbacks.
|
|
|
Powered by
FUDForum. Page generated in 0.03339 seconds