Using Ranorex 7.1 on Windows 7 and 10:
Calling Ranorex.Host.Local.OpenBrowser with the browsername being 'ie' and killExisting set to true, it sometimes throws a Win32Exception (as an inner exception of RanorexException) with the exception message 'Access is denied'. This seems to be purely sporadic and not specific to a certain test. The issue seems to be with the Browser killing because when splitting the method into Host.Local.KillBrowser and Host.Local.OpenBrowser, the KillBrowser method throws the Win32Exception directly
Any ideas?
Ranorex.Host.Local.OpenBrowser throws Win32Exception
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
Hi,
I'm experiencing a very similar problem with "Access is Denied" but in my case, it happens only with Chrome. I haven't thought that killExisting could be the source of issue! I will disable it in our tests and give it a shot.
I'm experiencing a very similar problem with "Access is Denied" but in my case, it happens only with Chrome. I haven't thought that killExisting could be the source of issue! I will disable it in our tests and give it a shot.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
I can confirm that the KillExisting parameter is indeed a cause of "Access is Denied" error occasionally thrown by OpenBrowser action. In our case, it's almost exclusively reproducible with Chrome browser. Error is no longer reproducible after disabling this parameter.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
Which version of Ranorex are you guys using? Please be more specific than "7.1" as there are 3 versions of 7.1 (.0, .1, & .2).
When listing the Ranorex version, please give the FULL version number.
When listing the Ranorex version, please give the FULL version number.
Shortcuts usually aren't...
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
I'm using 7.2, but I saw this "Access is denied" error even in 6.x.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
Hello everyone,
I am aware of a similar issue in Chrome.
Can you let me know what your exact error message is? We have seen the following message in the past:
To the customer that has reported this issue before we have suggested creating a new Chrome profile because this has resolved the issue when we have replicated it. Unfortunately, we have not heard back from that customer.
Can let me know if the issue is indeed the same and if it can be resolved by creating a new Chrome profile?
Sincerely,
Tomaž
I am aware of a similar issue in Chrome.
Can you let me know what your exact error message is? We have seen the following message in the past:
Code: Select all
Host.Local.OpenBrowser("https://www.google.com/","chrome","",True,True,True,False,True) //Clear Cache = True;
Error message: "Failed to open URL 'https://www.google.com/' with browser chrome. Access to the path 'data_0' is denied."
Can let me know if the issue is indeed the same and if it can be resolved by creating a new Chrome profile?
Sincerely,
Tomaž
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
In my case, the error message looks like this:
I will try to create a new chrome profile and let you know if it helped or not.Failed to open URL 'http://10.22.10.61' with browser Chrome.
Access is denied
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 13
- Joined: Thu Dec 08, 2016 1:46 am
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
I used to get this alot for a variety of reasons (mainly chrome staying open, bugging out staying open, etc...).
The way I solve it is:
1. Before openbrowser(), close all dom object that are chrome, i run a loop to ensure they are closed sometimes they don't close the first try. Something like this in a try catch:
DomObject = repo.DomToClose.BasePath.ToString();
IList<Ranorex.WebDocument> MyWebDocuments = DomObject.Find<Ranorex.WebDocument>(repo.DomToClose.BasePath.ToString());
foreach (Ranorex.WebDocument BrowserWindowsToClose in MyWebDocuments)
{
BrowserWindowsToClose.Close();
}
2. Make sure you always open chrome with the following argument "--disable-web-security --user-data-".
The way I solve it is:
1. Before openbrowser(), close all dom object that are chrome, i run a loop to ensure they are closed sometimes they don't close the first try. Something like this in a try catch:
DomObject = repo.DomToClose.BasePath.ToString();
IList<Ranorex.WebDocument> MyWebDocuments = DomObject.Find<Ranorex.WebDocument>(repo.DomToClose.BasePath.ToString());
foreach (Ranorex.WebDocument BrowserWindowsToClose in MyWebDocuments)
{
BrowserWindowsToClose.Close();
}
2. Make sure you always open chrome with the following argument "--disable-web-security --user-data-".
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
I'll add my 2 cents...
I almost always run web tests in Incognito mode. This means that nothing is saved from the session to the user profile. I also set the Ranorex browser plugin to be allowed in Incognito, or it wouldn't work...
I haven't seen the issues that you guys are talking about.
My guess would be that Ranorex is doing something that is causing the browser to mess up the profile...
Edit to add: Ranorex 7.1.2, but I didn't see it in 7.0.X or 6.X either, for what it's worth.
I almost always run web tests in Incognito mode. This means that nothing is saved from the session to the user profile. I also set the Ranorex browser plugin to be allowed in Incognito, or it wouldn't work...
I haven't seen the issues that you guys are talking about.
My guess would be that Ranorex is doing something that is causing the browser to mess up the profile...
Edit to add: Ranorex 7.1.2, but I didn't see it in 7.0.X or 6.X either, for what it's worth.
Shortcuts usually aren't...
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
OK, I've tried the "new profile" trick but this did not help. Some of our night tests again failed with "Access is denied" error. Once the KillExisting is disabled, the same tests passes OK.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
Hello everyone,
I have invested some time into this issue.
I can confirm that the error appears only when there is no delay between closing the browser at the end of your test case and reopening it again with the KillExisting attribute set to true.
For me the issue only happens when I am looping tests in Chrome.
By adding a delay of 5 seconds at the end of your test case (before the OpenBrowser is called again) the issue should be resolved. Could you try that?
Furthermore, I have tried to set the KillExisiting attribute to false and instead using the method System.Diagnostics.Process.Kill in the following way:
Please try to implement the delay in your solutions and let me know if it helps. If you are running the tests on a VM, then maybe a higher delay could be needed, try 10 seconds.
I hope this helps.
Sincerely,
Tomaž
I have invested some time into this issue.
I can confirm that the error appears only when there is no delay between closing the browser at the end of your test case and reopening it again with the KillExisting attribute set to true.
For me the issue only happens when I am looping tests in Chrome.
By adding a delay of 5 seconds at the end of your test case (before the OpenBrowser is called again) the issue should be resolved. Could you try that?
Furthermore, I have tried to set the KillExisiting attribute to false and instead using the method System.Diagnostics.Process.Kill in the following way:
public void Recording1_Open_Browser() { Report.Log(ReportLevel.Info, "Website", "Opening web site 'http://www.ranorex.com' with browser 'Chrome' in normal mode."); Process [] chromeInstances = Process.GetProcessesByName("chrome"); foreach(Process p in chromeInstances) try { p.Kill(); } catch (Exception e) { Report.Error(e.Message); } Host.Current.OpenBrowser("http://www.ranorex.com", "Chrome", "", false, false, false, false, false); }The exception "Access denied" is now raised by the Kill method. The report looks like this: Therefore, this seems to be a timing issue. The process that you are trying to kill is already gone before it can be killed.
Please try to implement the delay in your solutions and let me know if it helps. If you are running the tests on a VM, then maybe a higher delay could be needed, try 10 seconds.
I hope this helps.
Sincerely,
Tomaž
You do not have the required permissions to view the files attached to this post.
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
Hi Tomaz,
Thanks for the feedback. Your finding is consistent with my experience, where one test runs OK and the next one fails with "Access is denied" exception. We are going to add the delay and re-enable KillExisting in our tests. I should have some result for at Monday. Thanks.
Thanks for the feedback. Your finding is consistent with my experience, where one test runs OK and the next one fails with "Access is denied" exception. We are going to add the delay and re-enable KillExisting in our tests. I should have some result for at Monday. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Ranorex.Host.Local.OpenBrowser throws Win32Exception
Hi guys,
I forgot to update this post. Adding 5s delay definitely helps with "Access is denied" problem in Chrome (while using kill existing option).
I forgot to update this post. Adding 5s delay definitely helps with "Access is denied" problem in Chrome (while using kill existing option).
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration