Skip to main content



      Home
Home » Eclipse Projects » RCP Testing Tool » Properly Close AUT
Properly Close AUT [message #1444748] Tue, 14 October 2014 09:54 Go to next message
Eclipse UserFriend
Hello,
I want to properly close my AUT at the end of the test. How could I do it ?
If record
get-menu "File/Exit" | click
I got this error
Couldn't open ECL session
at java.net.PlainSocketImpl.socketConnect(Native Method)

Any suggestion is so welcome Smile
Re: Properly Close AUT [message #1444808 is a reply to message #1444748] Tue, 14 October 2014 11:26 Go to previous messageGo to next message
Eclipse UserFriend
Hello maherzia,

I tested on my application without results:
try {
    get-menu "File/Exit" | click
    //find a windows unknown
    get-window "FalseWindows"
    //wait-until-eclipse-is-ready
} -catch {}

Unfortunaly, I got the same error:
Couldn't open ECL session
at java.net.DualStackPlainSocketImpl.connect0(Native Method)

[Updated on: Tue, 14 October 2014 11:58] by Moderator

Re: Properly Close AUT [message #1444814 is a reply to message #1444808] Tue, 14 October 2014 11:31 Go to previous messageGo to next message
Eclipse UserFriend
thanks!
Re: Properly Close AUT [message #1445185 is a reply to message #1444748] Wed, 15 October 2014 01:04 Go to previous messageGo to next message
Eclipse UserFriend
Why do you need to close AUT?
Could AUT restart help? Following commands might be what you need:
 restart-aut
 wait-until-eclipse-is-ready
Re: Properly Close AUT [message #1445305 is a reply to message #1445185] Wed, 15 October 2014 04:57 Go to previous messageGo to next message
Eclipse UserFriend
Once all my tests are completed. I want to close an stop my AUT.
AUT restart command is good if I need to restart my AUT before launching new test.
Re: Properly Close AUT [message #1445971 is a reply to message #1445305] Thu, 16 October 2014 02:55 Go to previous messageGo to next message
Eclipse UserFriend
We do not have any commands to close the AUT. You can close it manually.
Re: Properly Close AUT [message #1446183 is a reply to message #1445971] Thu, 16 October 2014 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Ok. thanks.
Re: Properly Close AUT [message #1446402 is a reply to message #1446183] Thu, 16 October 2014 16:04 Go to previous messageGo to next message
Eclipse UserFriend
I found a solution for you if you use windows (if need, I have to be able to adapt on linux).
I created 2 scripts cmd (command line windows), and I put them d:\.

test.cmd
start d:\waitAndClose.cmd /wait 1

waitAndClose.cmd
rem sleep 5 sec
ping 1.1.1.1 -n 1 -w 5000 > nul
rem kill application with his name begin javaw
taskkill /IM javaw*
rem quit the window
exit

and your eclscript:
exec-process "d:\\test.cmd" -timeout 1

You have to adapt the directory.


For the explanation,rcptt starts application with name "javaw.exe" (it can possibly rename?)
The function exec-process starts test.cmd and its stop after 1 sec. Just the time starts other script cmd.
Finaly, waitAndClose, it waits 5 sec, it closes application with name begin "javaw" and itself closes.

If your AUT ask a confirmation to quit, you can add /F (taskkill /F /IM javaw*), this option forces the application to terminate

[Updated on: Fri, 17 October 2014 02:21] by Moderator

Re: Properly Close AUT [message #1446746 is a reply to message #1446402] Fri, 17 October 2014 04:48 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Francis !
I will try it asap
Re: Properly Close AUT [message #1698231 is a reply to message #1444748] Fri, 12 June 2015 07:35 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

the same problem applies with my application.
I need to exit the application via exit dialog including confirmation and then restart the application to confirm data has been correctly persisted.

For this reason I execute the following code snippet:

proc "logoutWithCheckouts" [val checkOuts]
{
       get-menu "Project/Exit..." | click
	if [$checkOuts] -then 
	{
		get-window -class VerifyCheckinDialog | get-button "Checkin" | click
	} -else	
	{
		get-window -class VerifyCheckinDialog | get-button "Keep checked out" | click
	}
	get-window -class ExitConfirmDialog | get-button Logout | click
        wait-until-eclipse-is-ready
}


Now I need to restart the aut.
restart-aut will result to the ECL session exception shown above.

Replacing the code above with
proc "logoutWithCheckouts" [val checkOuts]
{
        restart-aut
	if [$checkOuts] -then 
	{
		get-window -class VerifyCheckinDialog | get-button "Checkin" | click
	} -else	
	{
		get-window -class VerifyCheckinDialog | get-button "Keep checked out" | click
	}
	get-window -class ExitConfirmDialog | get-button Logout | click
        wait-until-eclipse-is-ready
}


has the same effect.
Any suggestions?

Best regards
Markus
Re: Properly Close AUT [message #1708500 is a reply to message #1698231] Thu, 17 September 2015 04:06 Go to previous message
Eclipse UserFriend
Has anyone managed to exit the out via File/Exit and delayed kill script and then restart it in the same testcase yet?

Any testcase that requires an Exit from the AUT by AUT means is quite difficult to manage for a lack of a ECL command that starts the AUT anew when it is already stopped. restart-aut is not an option as the tests require the AUT to exit by it's own mechanics.
Previous Topic:TreeViewers with Lazy Decorators
Next Topic:How to launch the AUT maximised?
Goto Forum:
  


Current Time: Tue Jun 17 00:34:02 EDT 2025

Powered by FUDForum. Page generated in 0.47676 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top