Page 1 of 1

CloseApplication

Posted: Mon Mar 14, 2011 3:57 pm
by JoeR
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

Re: CloseApplication

Posted: Mon Mar 14, 2011 4:25 pm
by sdaly
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);

Re: CloseApplication

Posted: Mon Mar 14, 2011 6:05 pm
by slavikf
Where i can find API description for following method?:

Code: Select all

Host.Local.CloseApplication ()

Re: CloseApplication

Posted: Mon Mar 14, 2011 7:34 pm
by Ciege

Re: CloseApplication

Posted: Mon Mar 14, 2011 7:42 pm
by Support Team
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

Re: CloseApplication

Posted: Tue Mar 15, 2011 1:56 pm
by JoeR
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