Page 1 of 1

Close Application

Posted: Wed Aug 30, 2017 12:45 pm
by karthikprs
Hi,

I found from one of the posts in the forum that to close an application, the code

Code: Select all

Host.Local.CloseApplciations(String ProcessName);
But in my application I've a validation done by a message box with Message
Do you want to close the application
with Yes and No buttons.

The code module does not perform the actions coded for the clicking of Yes or No button.

Request your help on that.

Thanks,
Karthik

Re: Close Application

Posted: Wed Aug 30, 2017 7:56 pm
by Support Team
Hi Karthikprs,

Since Ranorex detects your application did not fully close as expected with the CloseApplication method, it throws an exception and fails your test. To bypass this, throw the CloseApplication line in a try/catch block. When it fails (due to the popup), let it continue to your code clicking the 'Yes' button and continue your test.

I hope this helps!

Cheers,
Ned