ClearBrowserCache fails if provide userProfile

Bug reports.
Liss
Posts: 9
Joined: Sun Nov 22, 2015 3:04 pm

ClearBrowserCache fails if provide userProfile

Post by Liss » Thu Jun 02, 2016 7:47 pm

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

Liss
Posts: 9
Joined: Sun Nov 22, 2015 3:04 pm

Re: ClearBrowserCache fails if provide userProfile

Post by Liss » Thu Jun 02, 2016 8:35 pm

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?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: ClearBrowserCache fails if provide userProfile

Post by krstcs » Fri Jun 03, 2016 2:21 pm

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.
Shortcuts usually aren't...

Liss
Posts: 9
Joined: Sun Nov 22, 2015 3:04 pm

Re: ClearBrowserCache fails if provide userProfile

Post by Liss » Fri Jun 03, 2016 3:14 pm

Sorry, forgot to mention versions :oops:
Ranorex 5.4.6, Windows 10

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: ClearBrowserCache fails if provide userProfile

Post by krstcs » Fri Jun 03, 2016 3:33 pm

No worries! Happens to all of us! :D
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: ClearBrowserCache fails if provide userProfile

Post by Support Team » Mon Jun 06, 2016 2:58 pm

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
.
Image