Newbie request - Including Repository in Code library

Class library usage, coding and language questions.
Posts: 23
Joined: Mon Oct 17, 2011 5:31 pm

Newbie request - Including Repository in Code library

Post by orbistest » Mon Dec 17, 2012 10:25 am

Hi everyone,
I am developing a code library. I have used Findsingle to find GUI items using the RanorexPath for an item with no problem -
anObject = Host.Local.FindSingle(Of Ranorex.ListItem)(RanorexPath)

However I now want to do a lot more with the repository in my user code without having to copy over all the RanorexPaths for the items I want to interact with.
SO I have seen the bit of code in the recodings which says somethign like: -
''' <summary>
''' Holds an instance of the BaseProject.TestRepository repository.
''' </summary>
Public Shared repo as BaseProject.TestRepository = BaseProject.TestRepository.Instance

But I am not sure how I implement this in my user code library which is outside the project but called from the project. I know this will tie my user code library to this repository but, for our purposes this does not matter.

What I want to do is follow a standard set of steps which creates an on screen object at a particular position. The position should be a paramater (x,y). The actual object is always the same but takes several steps which is why I want to automate it. I know I could add x and y coords as variables to the script but I would prefer to add a single line of usercode to a recording with the x and y params decided by the tester at the time.

I hope I haven't confused you and I hope my request is clear.


User avatar
Support Team
Site Admin
Site Admin
Posts: 12173
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Newbie request - Including Repository in Code library

Post by Support Team » Tue Dec 18, 2012 1:57 pm


I am not sure I completely got it.
Could it be that you want to use the repository of your "main" solution in your user code library?

If you want that the coordinates should be specified by the tester you could use the data driven approach or a global parameter which could be set via for instance the command line.
For more information please take a look at the following links:
Data-Driven Testing
Running Test via Command Line