Page 1 of 1

Newbie request - Including Repository in Code library

Posted: Mon Dec 17, 2012 10:25 am
by orbistest
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)
anObject.EnsureVisible()
anObject.Click()

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.

Thanks.
orbistest

Re: Newbie request - Including Repository in Code library

Posted: Tue Dec 18, 2012 1:57 pm
by Support Team
Hi,

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

Regards,
Markus