Jubula API JAVA Swing "Timeout received" & "ActionException" [message #1773299] |
Tue, 26 September 2017 08:57 |
Rdg Kentin Messages: 6 Registered: September 2017 |
Junior Member |
|
|
Hello everybody !
I just started using the Jubula API to create automatic tests.
For the moment I am trying to launch an automatic test via the API and the SimpleAdder provides as an example of Jubula. When i start my test i have this execption : Timeout received before confirming the posted event
Here is my code:
public class SimpleAdder2 {
/** the value1 */
private static TextInputComponent value1;
/** the value2 */
private static TextInputComponent value2;
/** the button */
private static GraphicsComponent button;
/** the result */
private static TextComponent result;
/** the AUT */
private static AUT m_aut;
/** the AUT */
private static AUTAgent autAgent;
/** global prepare */
@SuppressWarnings("unchecked")
@BeforeClass
public static void loadObjectMapping() throws Exception {
URL input = SimpleAdder2.class.getClassLoader().getResource("objectMapping_AUTName.properties");
if (input != null) {
System.out.println("ObjectMapping properties find !");
ObjectMapping objectMapping = MakeR.createObjectMapping(input.openStream());
ComponentIdentifier<ButtonComponent> buttonId = objectMapping.get("equalsButton");
button = SwingComponents.createAbstractButton(buttonId);
ComponentIdentifier<TextInputComponent> value1Id = objectMapping.get("value1");
value1 = SwingComponents.createJTextComponent(value1Id);
ComponentIdentifier<TextInputComponent> value2Id = objectMapping.get("value2");
value2 = SwingComponents.createJTextComponent(value2Id);
ComponentIdentifier<TextComponent> resultFieldId = objectMapping.get("resultField");
result = SwingComponents.createJLabel(resultFieldId);
} else {
System.out.println("Can't find objectMapping properties");
}
}
/** prepare */
@Before
public void setUp() throws Exception {
System.out.println("createAUTAgent");
autAgent = MakeR.createAUTAgent("localhost", 60000);
try {
autAgent.connect();
System.out.println("AUTAgent connection success");
SwingAUTConfiguration autConfiguration = new SwingAUTConfiguration("AUTName", "AUTId", "SimpleAdder.cmd",
"C:\\Program Files\\jubula_8.5.0.127\\examples\\AUTs\\SimpleAdder\\swing", null);
AUTIdentifier id = autAgent.startAUT(autConfiguration);
m_aut = autAgent.getAUT(id, SwingComponents.getToolkitInformation());
m_aut.connect();
System.out.println("AUT connected");
} catch (Exception e) {
System.out.println("AUTAgent connection failed");
}
}
/** the actual test method */
@Test(expected = CheckFailedException.class)
public void testTestFirstSimpleAdderSteps() throws Exception {
System.out.println("Test start");
final int firstValue = 17;
List<Result<String>> results = new ArrayList<Result<String>>();
System.out.println("aut = " + m_aut + "value1 = " + value1);
try {
for (int i = 1; i < 5; i++) {
results.add(m_aut.execute(value1.replaceText(String.valueOf(firstValue)), "Entering first value")); //$NON-NLS-1$
results.add(m_aut.execute(value2.replaceText(String.valueOf(i)), "Entering second value")); //$NON-NLS-1$
results.add(m_aut.execute(button.click(1, InteractionMode.primary), "Invoking calculation")); //$NON-NLS-1$
results.add(m_aut.execute(result.checkText(String.valueOf(firstValue + i), Operator.equals),
"Checking result")); //$NON-NLS-1$
}
} finally {
System.out.println("finally");
}
}
/** cleanup */
@After
public void tearDown() throws Exception {
System.out.println("Disconnect AUT Agent and AUT");
if (m_aut != null) {
m_aut.disconnect();
autAgent.stopAUT(m_aut.getIdentifier());
}
autAgent.disconnect();
}
}
I receive this Timeout received before confirming the posted event and ActionException
Thank you
Best regards,
Kentin
[Updated on: Wed, 27 September 2017 12:40] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04779 seconds