CacheSession

Class library usage, coding and language questions.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

CacheSession

Post by atom » Tue Sep 28, 2010 6:30 pm

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

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

Re: CacheSession

Post by Support Team » Wed Sep 29, 2010 1:16 pm

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

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: CacheSession

Post by atom » Wed Sep 29, 2010 2:43 pm

Ok.. Dont suppose you have a code example?

Thanks

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

Re: CacheSession

Post by Support Team » Wed Sep 29, 2010 2:58 pm

Hi,

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

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: CacheSession

Post by atom » Wed Sep 29, 2010 5:19 pm

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

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

Re: CacheSession

Post by Support Team » Fri Oct 01, 2010 10:51 am

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