0

Is it possible to reinitialize (reset) a pyqt5 GUI App without needing to be closed and restarted? I mean to bring the Pyqt5 App to the original status (like deleting all entries that the user made after running it).

My problem: I'm using squish for Qt for testing. My ApplicationUnderTest (AUT) is used here as AttachedApp. Now when I run a test case and do some recording and then colse it, the AUT still have the modified state of the App (with all entries made in the previous testcase). Now when I want to record a new test case it will not work as I want, because I want that every test case shall be recorded and replayed without any kind of dependency on other test cases. I know that it's possible to let squish restart the AUT for every test case and thus it will be correctly reinitialized, but that's not what I want in this case. I want to let squish run the AUT only one time at the beginning and then attaching the AUT as used and then bring the AUT to original status for every test case without to restart it.

1 Answer 1

1

There is no such functionality in general in Qt, PyQt or any other mainstream programming language or application runtime system.

This aspect of "attaching to an already running application" is addressed by each Squish user individually, usually by some support for such an internal reset in the application itself, or by having script code that performs the necessary steps in the application. (The latter may run into problems, which means one should be able to let such script code restart the attachable application anyway, should resetting fail.)

If you do not want to reset the application via script code, and there is no functionality in the AUT to reset it, the only option is to restart it, but this of course goes against the intention of attaching to a running application (usually done to cut down on the time required to run the test cases/suites by reducing the amounts of application startups and shutdowns).

So if the application startup and shutdown times are your concern, and such a "reset" is not within reach for you, you probably should look into distributed, concurrent execution of test suites/cases across multiple systems.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.