如何检查我的应用程序是否已在 QFTest 中关闭?

huangapple go评论73阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年2月8日 18:37:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384531.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定