CacheSession : Automation API

CacheSession

Class library usage, coding and language questions.

CacheSession

Postby atom » Tue Sep 28, 2010 7: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
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: CacheSession

Postby Support Team » Wed Sep 29, 2010 2: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
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: CacheSession

Postby atom » Wed Sep 29, 2010 3:43 pm

Ok.. Dont suppose you have a code example?

Thanks
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: CacheSession

Postby Support Team » Wed Sep 29, 2010 3:58 pm

Hi,

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

Regards,
Peter
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: CacheSession

Postby atom » Wed Sep 29, 2010 6: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
...
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: CacheSession

Postby Support Team » Fri Oct 01, 2010 11: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
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests