How can I check that my application is shutdown with QFTest?

94 Views Asked by At

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

There are 1 best solutions below

0
On

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