英文:
How can I check that my application is shutdown with QFTest?
问题
I check a Java application with QFTest. I need to prove that the HMI is stopped at Shutdown.
In QFTest, I created a Jython procedure which tries to send a socket to the HMI. If it can't, it means that the HMI is stopped, and then the test is OK. Here is the Jython script:
import threading
import time
rc.setLocal("returnValue", False)
for i in range(50):
time.sleep(0.5)
try:
# Here we try to send a socket to HMI
rc.toSUT("client", vars)
except:
# Here there was an exception trying to send the socket, the HMI is shutdown: test OK."
rc.setLocal("returnValue", True)
break
It seems that the QFTest javaagent used to connect my Java program to QFTest prevents my application from being fully killed. Do you have an idea to prove that my HMI is killed in a QFTest procedure?
英文:
I check a Java application with QFTest. I need to prove that the HMI is stopped at Shutdown.
In QFTest, I created a Jython procédure which try to send a socket to the HMI, if it can't, then it means that the HMI is stopped and then the test is OK. here is the jython script:
import threading
import time
rc.setLocal("returnValue", False)
for i in range(50):
time.sleep(0.5)
try:
# here we try to send a socket to HMI
rc.toSUT("client", vars)
except:
# here there was an exception trying to send the socket, the HMI is shutdown: test OK."
rc.setLocal("returnValue", True)
break
It seems that the QFTest javaagent used to connect my Java program to QFTest, prevents my application to be fully killed. Have you an idea to prove that my HMI is killed in a QFTest procedure ?
答案1
得分: 1
你在关闭时应避免与SUT进行任何通信。QF-Tests 尝试优雅地停止应用程序,如果你记录了用户执行的步骤序列。还有专用节点。此外,你可以尝试终止SUT 客户端。例如,可以查看 QF-Test 附带的演示套件中的 startStop.terminate 程序构建,路径位于&qftest_isntall_dir&\demo\carconfig\carconfig_en.qft。
如果问题持续存在,你应该向 QF-Test 支持团队写信,因为可能需要额外的细节,而 stackoverflow.com 不适合此类通信。
免责声明:我是 QF-Test 员工。
英文:
You should avoid any communication with the SUT while shutting down. QF-Tests tries to stop the application gracefully, if you record a sequence for the steps a user would do. There are also the dedicated nodes Additionally you may try to kill the SUT-client. For example of such a construct look in the procedure startStop.terminate from the demo suite delivered with QF-Test under <qftest_isntall_dir>\demo\carconfig\carconfig_en.qft.
If the problem persist you should write to the QF-Test support, since additional details my be required, and the stackoverflow.com is not suitable for such communcation.
Disclaimer: I am a QF-Test Employee
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论