disable caching for the parent folder

Ask general questions here.
marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

disable caching for the parent folder

Post by marcushe » Fri Jun 19, 2009 10:45 am

When i execute project, i got "Failed to find item 'xxxx' using cached folders,trying again without cache".
During creating project ,i moved the caught objects from their default parent to the other . How can i modify cached folder?

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

Re: disable caching for the parent folder

Post by Support Team » Fri Jun 19, 2009 12:43 pm

In the folder containing the item, open the properties and set "Use Cache" to false.

Michael
Ranorex Team
.
Image

cancerion
Posts: 30
Joined: Tue Jun 16, 2009 6:15 pm

Re: disable caching for the parent folder

Post by cancerion » Wed Aug 26, 2009 11:17 am

Hi,

I am also getting same warning in Ranorex log.
Can you please tell me what will be the impact of “disable caching for the parent folder” on identification of the controls for this parent folder?

Sometimes if I didn’t disable cacheing, it gave warning and failed the steps.

Is there any one place in repository where I can disable the caching?

I could not find UseCache() details in documentation.

Thanks,
Sachin

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

Re: disable caching for the parent folder

Post by Support Team » Wed Aug 26, 2009 1:33 pm

Folder caching in Ranorex repositories tries to minimize the number of times a folder is searched using its path. That means, a rooted folder is only searched once using its path and from then on the element instance of the folder is used to search relatively for its children. The cached element instance for that folder is used as long as it gets invalid.

The methods used to determine if an element is invalid are technology specific, especially for MSAA elements they depend on the MSAA implementation of the corresponding control. That's why sometimes a folder element seems to be valid to Ranorex although it is not. In that case you will get that warning in your report and you should try to disable caching for that folder.

Disabling caching for rooted folders has some downsides and should only be done on a per item basis, that's why there is no global flag to disable folder caching: Firstly, performance will decrease since the folder element will be searched using its RanoreXPath whenever you access a child item of the folder. Secondly, if there are two elements that correspond to the folder's RanoreXPath, it is not guaranteed which element is found when the folder item is used several times. I.e. if you have two applications with the same title and a folder which path searches for a form with that title, it's not guaranteed that the same form will always be found if you have "Use Cache" disabled for that folder. If you have folder caching enabled, the same form will always be returned for that folder repository item (as long as the same repository is used or the form element gets invalid).

The "Use Cache" property is covered by the following chapter in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... html#c2076

Regards,
Alex
Ranorex Support Team
.
Image

cancerion
Posts: 30
Joined: Tue Jun 16, 2009 6:15 pm

Re: disable caching for the parent folder

Post by cancerion » Wed Aug 26, 2009 2:20 pm

Thanks for your reply

As per given instruction in given link:
http://www.ranorex.com/support/user-gui ... html#c2076

I have created a repository and it has default settings i.e. ‘Enable Folder Caching’ is checked in repository configuration setting.

Can you please tell me where I can verify this setting in C# generated repository file?
How can we decide at the time of development that should we disable/enable the cache?

Or every time we need to check the logs, if it is giving warning then disable it for that particular item and later on enable it again?

Thanks,
Sachin

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

Re: disable caching for the parent folder

Post by Support Team » Wed Aug 26, 2009 3:30 pm

Each folder has the property UseCache which returns a value indicating whether folder caching is used or not. In the generated C# code file you can see the value this property is set to when you look at the constructor of the folder class, it's the last value passed to the base constructor.
cancerion wrote:Or every time we need to check the logs, if it is giving warning then disable it for that particular item ...?
Right, you should only set "Use Cache" to false for a folder item if you see the warning mentioned above in your reports. Generally, you should have to do that very seldom, if you see that warning message for many different controls, please send a bug report with a detailed description of the control and (if possible) a sample application to support_at_ranorex.com!

Regards,
Alex
Ranorex Support Team
.
Image