I am creating automation tests using Squish, application depends on hardware, so I cannot kill application from processes because it is not good for hardware. When test cases are failed, the script just clicks the Shutdown button. But I don't know the state of application in advance and the Shutdown button could be obscured by other windows, so I need to find the top or active window and close it first.
Is there any way to find the top or active window in Squish? I am using python for Qt application.