Open Browser action fails when used with Clear Cache

Ranorex Studio, Spy, Recorder, and Driver.
McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Open Browser action fails when used with Clear Cache

Post by McTurtle » Thu Mar 08, 2018 2:54 pm

Hello Sae1962,

If you check the code in the post, then you will see that the "killexisting" flag is set to false for the open-browser action: Ranorex.Host.Local.OpenBrowser throws Win32Exception

From your post I am not sure that you have set this to false. Simply make sure that the following is considered:
1. When one iteration is finished there is a close browser at the end of that iteration.
2. The new iteration starts with a 10 sec delay or the previous one ends with a 10 sec delay.
3. Only after that the Open-Broweser action is called and the kill-existing flag is set to false.

Does it work now?

Regards,
McTurtle

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Open Browser action fails when used with Clear Cache

Post by odklizec » Thu Mar 08, 2018 3:06 pm

Hi McTurtle,

The point of delay is that the OpenBrowser action (with ENABLED KillExisting flag) does not fail with "Access is denied" message. In other words, if KillExisting is False, there is no need for adding delay before OpenBrowser action ;) But I guess this is what Sae1962 actually wants...Open Browser action with enabled Kill Existing flag?
Pavel Kudrys
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

Sae1962
Posts: 15
Joined: Tue Feb 06, 2018 4:25 pm

Re: Open Browser action fails when used with Clear Cache

Post by Sae1962 » Fri Mar 09, 2018 10:35 am

Is there any solution for this problem? If you are a Ranorex expert, you may access my PC to see on the premises what happens.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Open Browser action fails when used with Clear Cache

Post by odklizec » Fri Mar 09, 2018 10:45 am

Hi,

The solution is Close Browser, add delay (at least 5000ms) after Close Browser action or before Open Browser action. This workaround definitely works.

Are you using close browser as mentioned in one of my my previous posts?...

Code: Select all

Host.Current.CloseApplication(YourRepo.DomElement.Self, new Duration(0));
Pavel Kudrys
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

Sae1962
Posts: 15
Joined: Tue Feb 06, 2018 4:25 pm

Re: Open Browser action fails when used with Clear Cache

Post by Sae1962 » Fri Mar 09, 2018 10:52 am

Here is my code. Unfortunately, I do not know how to determine MyRepo at that code location. Therefore, I cannot use exactly your method call.
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Open Browser action fails when used with Clear Cache

Post by odklizec » Fri Mar 09, 2018 11:58 am

You need to instantiate your repository so it will be visible in code module.

Code: Select all

using Ranorex.Core.Repository;
...
    public class UserCodeCollection
    {
        private static ProjectName.ProjectNameRepository repo = ProjectName.ProjectNameRepository.Instance;
        ...
        Host.Current.CloseApplication(repo.DomElement.Self, new Duration(0));
Pavel Kudrys
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

mattmccall
Posts: 34
Joined: Mon Nov 12, 2012 8:13 pm

Re: Open Browser action fails when used with Clear Cache

Post by mattmccall » Wed Mar 20, 2019 7:46 pm

I am having the exact same issue now. Was a resolution found?

Ranorex 8.3.1

I am trying to find a way to execute tests without needing to run Ranorex as admin. I cannot give the access to everyone to be able to do run Ranorex as admin. If everyone runs as admin I do not have a problem.

I have all the settings and tricks mentioned in this thread and I am still getting the error.

If another user is logged in and executing tests Chrome is open and if I try to run my tests I get the error. Once those tests are done and the Chrome processes are closed then my tests work as expected.

User avatar
N612
Posts: 135
Joined: Mon Jul 11, 2016 4:01 pm

Re: Open Browser action fails when used with Clear Cache

Post by N612 » Fri Mar 22, 2019 11:07 pm

mattmccall wrote:
Wed Mar 20, 2019 7:46 pm
I am having the exact same issue now. Was a resolution found?

Ranorex 8.3.1

I am trying to find a way to execute tests without needing to run Ranorex as admin. I cannot give the access to everyone to be able to do run Ranorex as admin. If everyone runs as admin I do not have a problem.

I have all the settings and tricks mentioned in this thread and I am still getting the error.

If another user is logged in and executing tests Chrome is open and if I try to run my tests I get the error. Once those tests are done and the Chrome processes are closed then my tests work as expected.
Just to confirm your issue is the same as the one initially mentioned on this thread, are you receiving an "Access to the path 'data_0' is denied" error when trying to launch Chrome with the "Clear cache" or "Kill Existing" property set to "True"?

If so, this can be resolved by ensuring all Chrome processes are fully closed before launching Chrome with either of these properties enabled. Even background Chrome process will cause this error. The easiest way to ensure Chrome does not remain open in the background after closing it is to disable the below option in Chrome (under "Advanced" settings).
disabled.png
Hope this helps!
You do not have the required permissions to view the files attached to this post.

SumayaKhan
Posts: 1
Joined: Thu Oct 24, 2019 5:28 pm

Re: Open Browser action fails when used with Clear Cache

Post by SumayaKhan » Thu Aug 06, 2020 3:40 pm

This issue is not fixed yet. I still get the error - ESPECIALLY when the previous test fails. I have a 7 second wait time in between each test case (basically at the end of each test case in the Teardown after browser is closed). Its quite frustrating because this creates false multiple false failures that requires me to re-run the failed ones to ensure that the tests are passing - hence this is wasting a lot of time.
Any other suggestions than the ones mentioned so far in the forums?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Open Browser action fails when used with Clear Cache

Post by odklizec » Tue Aug 11, 2020 9:50 pm

Hi,

I’m afraid, there are no other suggestions related to this issues. And because it happens only with Chrome (Chromium-based Edge), it appears to be a problem with Chrome and not Ranorex as such? But I can be wrong 😉 A forced delay, right after killing browser and before opening new instance, definitely helps with this problem.
Pavel Kudrys
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