Programmatically set base path on repository?

Ask general questions here.
chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Programmatically set base path on repository?

Post by chrisgeorge » Thu Aug 27, 2009 3:13 pm

Hi,

Is there a way to set the base path of an application in the element repository from my test code? We run several instances of the application under test and have to define the application form by unique rxpaths.

To eliminate the chance of any problems I also want to do that when using elements from the repository.

Is this possible? I don't want to change any code in my generated .cs file as it will be changing for a while yet.


Thanks

Chris
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge

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

Re: Programmatically set base path on repository?

Post by Support Team » Thu Aug 27, 2009 4:17 pm

Chris,
You can set the BasePath property on the folder you wish to modify e.g.:
yourRepo.FormApp1.BasePath = "/form[@processname='yourapp' and @title='...'";
The basepath can be changed for every rooted or application folder.
You can also change timeouts and caching behavior in the same manner.

Michael
Ranorex Team
.
Image

chrisgeorge
Posts: 49
Joined: Thu Aug 20, 2009 11:28 am

Re: Programmatically set base path on repository?

Post by chrisgeorge » Fri Aug 28, 2009 8:22 am

ah cool! :-) Thanks guys!
Chris George
Test Engineer

Red Gate Software Ltd
Cambridge