Page 1 of 1

Closing the Edge Browser

Posted: Mon Jul 01, 2019 7:32 am
by loonquawl
I'm trying to close the Edge Browser.
Opening it via 'OpenBrowser' works, and the Website can be interacted with and tracked as normal, but if I try to Spy or Track the Browser itself (for instance the close-button in the upper righthand corner) it does not work well (the red frames that show what item was tracked do not appear for most elements). I cannot use CloseApplication, as i do not seem to have an element that works as an input (the Action is completetd without error, but Edge stays open)

Anybody have a solution?

Re: Closing the Edge Browser

Posted: Mon Jul 01, 2019 9:42 am
by odklizec
Hi,

Close Application should work just fine, as long as you assign it with DOM repo element. At least it works for me?

Re: Closing the Edge Browser

Posted: Thu Aug 29, 2019 5:41 pm
by natesun
Hi,

I have similar issues, when directly setting Host.Local.OpenBrowser() and overwrite killExisting to true, edge does not close.

When trying to get doms by using Host.Local.FindChildren<Ranorex.Webdocument>(), Edge would close but opens again. Is this a bug within Ranorex or do I miss anything?

Thanks,
Nate

Re: Closing the Edge Browser

Posted: Wed Mar 24, 2021 12:27 pm
by YvesL
I also have this issue with Edge: the browser does not close, while the same method works with IE, Chrome and Firefox.

I use this C# code to close the browsers: (NB: "FindChildren" method is deprecated, so I use "Find")

IList<Ranorex.WebDocument> webList = Host.Local.Find<Ranorex.WebDocument>("/dom");
foreach (Ranorex.WebDocument webdoc in webList)
{
Report.Log(ReportLevel.Info, "Closing browser window for: " + webdoc.BrowserName);
webdoc.Close();
}