The testing Tool Squish closes my Application after every Test Case, How can I avoid that? I even unchecked "Automatically start the AUT" and start the Application with startApplication(). I also tried the attachToApplication() methode without success!
Thanks a lot my friends
Martin
The testing Tool Squish closes my Application after every Test Case, How can I avoid that? I even unchecked "Automatically start the AUT" and start the Application with startApplication(). I also tried the attachToApplication() methode without success!
Thanks a lot my friends
Martin
Share Improve this question asked Apr 25, 2014 at 11:52 user1988293user1988293 1351 silver badge7 bronze badges2 Answers
Reset to default 6Basically, 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 mand 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 mand "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 mand).
Hope this will help you, thanks!
Attachable AUT approach es with additional effort when it es to setting context to start test script.
Putting the AUT in the right context is important for any automation test to be executed. Squish default behavior is to kill the application at the end of the test so it guarantees that you start and end your tests at the same point. In the normal approach, nothing to worry about bringing the application to a mon known state as it will always start by starting the application and stop by killing it.
As explained by @Lowitty, if you are to use attach to already running AUT approach (if that is what suites your need), then you must make sure to use proper cleanup steps at the end of each test which will set your AUT to initial context, so that the next test script can start over from there.