Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Properly Close AUT
Properly Close AUT [message #1444748] Tue, 14 October 2014 13:54 Go to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
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 15:26 Go to previous messageGo to next message
Francis BACQUET is currently offline Francis BACQUETFriend
Messages: 46
Registered: September 2014
Member
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 15:58]

Report message to a moderator

Re: Properly Close AUT [message #1444814 is a reply to message #1444808] Tue, 14 October 2014 15:31 Go to previous messageGo to next message
Grant Velazquez is currently offline Grant VelazquezFriend
Messages: 1
Registered: October 2014
Location: New York
Junior Member
thanks!
Re: Properly Close AUT [message #1445185 is a reply to message #1444748] Wed, 15 October 2014 05:04 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

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


Yours sincerely,
Olga.
Re: Properly Close AUT [message #1445305 is a reply to message #1445185] Wed, 15 October 2014 08:57 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
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 06:55 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

We do not have any commands to close the AUT. You can close it manually.

Yours sincerely,
Olga.
Re: Properly Close AUT [message #1446183 is a reply to message #1445971] Thu, 16 October 2014 13:17 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
Ok. thanks.
Re: Properly Close AUT [message #1446402 is a reply to message #1446183] Thu, 16 October 2014 20:04 Go to previous messageGo to next message
Francis BACQUET is currently offline Francis BACQUETFriend
Messages: 46
Registered: September 2014
Member
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 06:21]

Report message to a moderator

Re: Properly Close AUT [message #1446746 is a reply to message #1446402] Fri, 17 October 2014 08:48 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
Thanks Francis !
I will try it asap
Re: Properly Close AUT [message #1698231 is a reply to message #1444748] Fri, 12 June 2015 11:35 Go to previous messageGo to next message
Markus Manck is currently offline Markus ManckFriend
Messages: 34
Registered: June 2015
Member
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 08:06 Go to previous message
Markus Manck is currently offline Markus ManckFriend
Messages: 34
Registered: June 2015
Member
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: Fri Apr 26 00:23:28 GMT 2024

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

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

Back to the top