Page 1 of 1

ClearBrowserCache fails if provide userProfile

Posted: Thu Jun 02, 2016 7:47 pm
by Liss
Hi,

I have a question regarding the usage of Host.ClearBrowserCache() method. It has an overload that takes 'userProfile' string as a parameter. But when I'm passing my profile name it fails although the profile actually exists

Code: Select all

No firefox profile found matching the display name '{myprofilename_goes_here}'
   at Ranorex.Core.Utils.Domain.Browser.GetFirefoxProfiles(String dir)
   at Ranorex.Core.Utils.Domain.Browser.DoForAllFirefoxProfilesIn(SpecialFolder folder, RxAction`1 action)
   at Ranorex.Core.Utils.Domain.Browser.PrepareFirefox()
   at Ranorex.Core.Utils.Domain.Browser.<GetBrowserPrepareStrategies>b__69_2()
   at Ranorex.Core.Utils.Domain.Browser.Prepare()
   at Ranorex.Host.ClearBrowserCache(String browserName, String userProfile)
Which format of the profile name does it expect? I pass it simply as a profile name (e.g. 'test_profile')

P.S. I use FireFox

Re: ClearBrowserCache fails if provide userProfile

Posted: Thu Jun 02, 2016 8:35 pm
by Liss
Okay, I've disassembled the Ranorex.Core library and found the reason why it failed for me:

Code: Select all

List<string> list = RxLinq.Query<string>((IEnumerable<string>) directories).Where((RxFunc<string, bool>) (d => d.EndsWith(string.Format(".{0}", (object) this.UserProfile)))).ToList();
      if (list.Count != 0)
        return list;
      throw new ArgumentException(string.Format("No firefox profile found matching the display name '{0}'", (object) this.UserProfile));
The method does expect that the profile directory ends with profile name following a dot. I believe this is usual way how FF profiles are being created but from the other hand, there is a possibility to provide custom directory when creating a new profile:

Code: Select all

-CreateProfile "profile_name profile_dir"
where profile_dir can be any valid name, not necessarily containing dot before the profile name.
And this is what I actually did :?

Is this something worth to fix or document?

Re: ClearBrowserCache fails if provide userProfile

Posted: Fri Jun 03, 2016 2:21 pm
by krstcs
Please always include the following when raising an issue on the forums:

Ranorex version (6.0.0 is current, 5.4.6 is previous supported)
Windows version


I believe this is a bug in Ranorex as it should allow any valid name that FF allows.

Ranorex team, please move this thread to the Bug Reports forum.

Re: ClearBrowserCache fails if provide userProfile

Posted: Fri Jun 03, 2016 3:14 pm
by Liss
Sorry, forgot to mention versions :oops:
Ranorex 5.4.6, Windows 10

Re: ClearBrowserCache fails if provide userProfile

Posted: Fri Jun 03, 2016 3:33 pm
by krstcs
No worries! Happens to all of us! :D

Re: ClearBrowserCache fails if provide userProfile

Posted: Mon Jun 06, 2016 2:58 pm
by Support Team
Hi Liss,

Thank you for reporting this issue. I already added it to our internal bug-tracking system.

Currently, we do not know if and when this issue will be fixed. This depends on various factors. Nevertheless, all reported bugs and feature requests are documented in the release notes, with every new version release of Ranorex.

Thank you for your understanding.

Sincerely,
Johannes