Enabled caching prevents reliable update of gui-changes

Bug reports.
jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

Enabled caching prevents reliable update of gui-changes

Post by jabelshauser » Thu Jul 08, 2010 11:49 am

In case of row-changes in an Xceed-table, the update of the Element-structure isn't reliable. If i disable the caching, it works (most likely)

Ranorex 1.5.3 used with .Net 1.1

Anyone an Idea ?

best regards jörg

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

Re: Enabled caching prevents reliable update of gui-changes

Post by Support Team » Thu Jul 08, 2010 5:28 pm

jabelshauser wrote:the update of the Element-structure isn't reliable
Could you explain that issue a little more in detail? What is the current behavior of Ranorex if the GUI changes and what would you expect? If the GUI changes, Element instances could get invalid (e.g. if the control implementing MSAA constructs new MSAA objects on change) and you might need to search for the element again.

In Ranorex 1.5 Element.EnableCaching does not actually perform a caching algorithm (it's a badly chosen name, maintained solely for backwards compatibility). When you set it to true, every Element instance will keep its association with the underlying MSAA object (usually a good and expected thing). If you set the property to False, everytime you access the Element instance, Ranorex internally searches again for the corresponding MSAA object inside the associated window.

Regards,
Alex
Ranorex Team
.
Image

jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

Re: Enabled caching prevents reliable update of gui-changes

Post by jabelshauser » Wed Jul 28, 2010 7:17 am

if a row was added or removed to the table by example, sometimes(!) the element-structure is not enhanced, so the new row-element isn't avl. It is right, that i have to search for the element again, but how can i do that ? start from the initial point (= SUT-Gui) isn't a good idea, because it takes a very long time each time. An "update"-command isn't available. What is the prefered procedure in this case ?

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

Re: Enabled caching prevents reliable update of gui-changes

Post by Support Team » Wed Jul 28, 2010 6:01 pm

I still don't really understand what you mean by "the element-structure is not enhanced". Could you give a detailed example? How do you access the rows? Do you search using Element.FindChildren?

When you search for rows e.g. using the Element.FindChildren method, you get the elements corresponding to the currently present rows. If you then add or delete rows, the returned Element array won't change unless you do a new search.

Usually, it should be enough to start searching from the table element again. E.g. when you add a new row, you then need to start searching for that row from the table control/element. When you still have Element instances corresponding to a deleted row, those elements will most likely return invalid results.

Ranorex 2.X facilitates getting new elements for changed UIs by means of RanoreXPath and the Ranorex repository. RanoreXPath makes it easier to search for elements and the repository provides mechanisms to automatically search for elements again that got invalid.

Regards,
Alex
Ranorex Team
.
Image