Page 1 of 1

CacheSession

Posted: Tue Sep 28, 2010 6:30 pm
by atom
Hiya

Not sure if ive asked this before, but we would like to create a CacheSessionContext on 1 element only, and not all elements. The reason (as always) is we want Ranorex to cache our large MSAA table, but not to cache all other normal operations to text boxes etc.

Is there a way to do that at the moment?

Thanks

Re: CacheSession

Posted: Wed Sep 29, 2010 1:16 pm
by Support Team
Hi,

Of course it is possible to use the CacheSessionContext only for one element. Just place the code for the CacheSessionContext around your element in the same way you do it for your large MSAA table.

Regards,
Peter
Ranorex Team

Re: CacheSession

Posted: Wed Sep 29, 2010 2:43 pm
by atom
Ok.. Dont suppose you have a code example?

Thanks

Re: CacheSession

Posted: Wed Sep 29, 2010 2:58 pm
by Support Team
Hi,

Sample Code:
using (new Ranorex.Core.CacheSessionContext())
{
	//Do your element actions
}
Regards,
Peter
Ranorex Team

Re: CacheSession

Posted: Wed Sep 29, 2010 5:19 pm
by atom
Ahh what i expected...
The problem is we use the MSAA table, then use a text box, then use the table again etc...
So we do not do all table actions in one block of code

What im looking for is something like:

Dim myTable as Ranorex.Table = ...
myTable.CacheStart
.....
do some ops on table and other controls
...
myTable.CacheEnd

Infact we got a solution
We do the following:

Dim myTable as Ranorex.Table = ...
Dim myRows as IList(of Ranorex.Row) = myTable.Rows
...
use myRows collection to interact not myTable
...

Re: CacheSession

Posted: Fri Oct 01, 2010 10:51 am
by Support Team
Hi,

You can use the CacheSessionContext for each item you want. In you case for each action you want perform, I would put around the session and close it after your actions were performed. For example
using(new CacheSessionContext())
{
  //perform table actions
}
using(new CacheSessionContext())
{
  //perform some actions on a textbox
}
Regards,
Peter
Ranorex Team