CloseApplication

Ask general questions here.
JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

CloseApplication

Post by JoeR » Mon Mar 14, 2011 3:57 pm

There is a new CloseApplication action available in the recordings for 3.0. Can that be used to close a browser window and if so how?

Joe

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: CloseApplication

Post by sdaly » Mon Mar 14, 2011 4:25 pm

To close a DOM, you should be able to use the WebDocument Close method as below -

Code: Select all

Ranorex.WebDocument dom = "/dom[@domain='www.ranorex.com']";
dom.Close();
To use the CloseApplication, you can do the following to close the application in which the element resides-

Code: Select all

Ranorex.MenuItem mi = "RxPath";
Host.Local.CloseApplication(mi);

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: CloseApplication

Post by slavikf » Mon Mar 14, 2011 6:05 pm

Where i can find API description for following method?:

Code: Select all

Host.Local.CloseApplication ()

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: CloseApplication

Post by Ciege » Mon Mar 14, 2011 7:34 pm

If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: CloseApplication

Post by Support Team » Mon Mar 14, 2011 7:42 pm

JoeR wrote:There is a new CloseApplication action available in the recordings for 3.0. Can that be used to close a browser window and if so how?
Yes, as the API documentation points out, this method closes the application or web page which contains the specified element, respectively. Just pass in an element of the application/web site and Ranorex will try to close the application/web site.

Regards,
Alex
Ranorex Team

JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

Re: CloseApplication

Post by JoeR » Tue Mar 15, 2011 1:56 pm

Thanks guys,

I had trouble getting this to work by just pointing to an element trying to close the application. I finally used the root dom i.e. /dom[@domain='ipaddress:port']. This worked.

Again thanks