Basically, if you use Squish by the default or start your AUT using "startApplication", the Squish will terminate the application just after the test case.
Fortunately, Squish has provided a way to fulfill your situation, that is attachToApplication
.
When using this way, squish will not terminate the AUT when it finished a test case. Referring to this link: Attaching to running applications. There are three steps to attach the application. I have checked and it works in windows platform, and I guess it will also work for other platforms.
Start the AUT with a certain port. You need to start the application using the squish's application named startxxxAUT
, startwinaut
in windows. This application is under the directory of where your Squish installed. e.g. <Squish-Install-DIR>/bin/startwinaut
startwinaut --port=8899 c:/Installed/notepad/notepad++.exe
Next step, register your application in squish, you can use command squishserver --config addAttachableAUT note 8899
to register your AUT. Or, you can perform this action with Squish IDE. <Edit>--<Server Settings>--<Manage AUTs...>--<Attachable AUTs>--<Add>
. Referring to the screen shot:
Please remember that the port number should match the one that you use to start your AUT.
The fininal step, attach the AUT in your script, like below:
def main():
attachToApplication("note")
snooze(10)
B.T.W, you can use "subprocess.popen
" to execute the command "startwinaut --port=8899 c:/Installed/notepad/notepad++.exe
" to start your AUT if you need to start your AUT in an automated way(Not manually typing the command).
Hope this will help you, thanks!