tosca

Tosca - Java Exception while running Swing Application (JTree)


I am learning tosca and currently we are trying to run a regression test suite for a legacy Java Swing application.

My Test suite contains 4 modules (in JTree) and it is getting failed while clicking a node.

The Error I received on the module is,

at.tosca.javaengine.common.exceptions.ControlException: node or node-path not found!
Detailed information contained in 'JavaEngineException.txt
above message is displayed in Executionlist

JavaEngineException.txt

22-11-2017 - 17:56:37: IExecWrapperInterface_connectToControl
at.tosca.javaengine.common.exceptions.ControlNotFoundException: Unable to find control Index=3;ClassName(s)=[javax.swing.JTable];.

at.tosca.javaengine.server.tree.ComponentSearch.getComponent(ComponentSearch.java:218)
->at.tosca.javaengine.server.AbstractJavaEngineCore.findComponent(AbstractJavaEngineCore.java:1129)
->at.tosca.javaengine.server.AbstractJavaEngineCore.connectToControlInternal(AbstractJavaEngineCore.java:936)
->at.tosca.javaengine.server.AbstractJavaEngineCore.connectToControlInternal(AbstractJavaEngineCore.java:922)
->at.tosca.javaengine.server.AbstractJavaEngineCore.connectToControl(AbstractJavaEngineCore.java:313)
->at.tosca.javaengine.server.JavaEngineCore.access$101(JavaEngineCore.java:25)
->at.tosca.javaengine.server.JavaEngineCore$2.runInternal(JavaEngineCore.java:69)
->at.tosca.javaengine.server.control.WorkerThread.run(WorkerThread.java:69)
->java.lang.Thread.run(Unknown Source)
->JNIServer::CallVoidMethod
->CJNIServer::CallVoidMethod

22-11-2017 - 17:58:58: IExecWrapperInterface_setValue
at.tosca.javaengine.common.exceptions.ControlException: node or node-path not found!

at.tosca.javaengine.server.control.swing.GenericTreeControl.setValueLegacy(GenericTreeControl.java:339)
->at.tosca.javaengine.server.control.swing.GenericTreeControl.setValue(GenericTreeControl.java:88)
->at.tosca.javaengine.server.AbstractJavaEngineCore.setValueInternal(AbstractJavaEngineCore.java:1195)
->at.tosca.javaengine.server.AbstractJavaEngineCore.setValue(AbstractJavaEngineCore.java:686)
->at.tosca.javaengine.server.JavaEngineCore.access$401(JavaEngineCore.java:25)
->at.tosca.javaengine.server.JavaEngineCore$5.runInternal(JavaEngineCore.java:114)
->at.tosca.javaengine.server.control.WorkerThread.run(WorkerThread.java:69)
->java.lang.Thread.run(Unknown Source)
->JNIServer::CallVoidMethod
->CJNIServer::CallVoidMethod

NOTE : The same Test suite is working in some other machine and not here. Both are same operating System.


Solution

  • The problem was TOSCA is faster than our application :)

    Meaning: The frame was not loaded at the time when TOSCA was trying to scan the next page causing the error, the specific node was not found.

    Solution: I added a TBoxWait with extra seconds, after that this is working fine.