Page 1 of 1

How to properly close the chrome Browser making sure that it is not even running the background

Posted: Thu Apr 18, 2019 2:53 pm
by premravi
Hi,

I am struggling to close the browser in a decent way so that it will not run continue running in the background

I tried :
1. Host.local.KillBrowser
2. foreach (WebDocument dom in Host.Local.Find<WebDocument>("/dom[@browsername='Chrome']"))
dom.close();
3. Host.local.CLoseApplication("ProcessId") >>>> Not sure how to get the processId , moreover if we get also do not know how reliable it will be, but please let me know how to get the processId
4. I turned off the google Advanced settings of "Continue running apps when google chrome is close"

Tried with all the above ways to make sure the chrome is closed properly without running in the background but no luck

Please help me with an approach wherein chrome gets closed successfully even from the background also (Task Manager) so that no restore pop up message will appear the second when we launch chrome

Please refer the attached screenshot

Regards

Re: How to properly close the chrome Browser making sure that it is not even running the background

Posted: Thu Apr 18, 2019 3:16 pm
by odklizec
Hi,

Unchecking "Continue running background apps when Google Chrome is closed" should definitely stop running Chrome in background. So once the Chrome is closed from Ranorex (and the option is disabled), Chrome should be terminated for good. I'm using this approach in various projects and everything works as expected?

What happens, if you uncheck this option and then close Chrome manually? Does it disappear from Task Manager?

Re: How to properly close the chrome Browser making sure that it is not even running the background

Posted: Thu Apr 18, 2019 3:19 pm
by premravi
Hi,

I thought the same,

But checking that box also I am getting Restore pop up in my browser

There is not problem in handling actually I am using popup watcher for that

But here the point is why is it coming as it is checked in the settings

Moreover which approach to use to close the browser ?

Please suggest

Re: How to properly close the chrome Browser making sure that it is not even running the background

Posted: Thu Apr 18, 2019 3:30 pm
by odklizec
Hi,

The 'restore' popup is unfortunately a Chrome-related problem and I found no other solution than using popupwatcher as well. Generally speaking, we should close browser via [x] button and not KillBrowser or kill process, which may terminate browser ungracefully and therefore Chrome issues this message. But I occasionally saw this popup even after closing Chrome via [x] button. So popupwatcher is probably the best workaround ;)