Referencing Repository within User Code

Ask general questions here.
rhx
Posts: 15
Joined: Thu Jan 05, 2017 7:01 pm

Referencing Repository within User Code

Post by rhx » Wed Jan 11, 2017 3:50 pm

I would like to reference my Repo within a UserCodeCollection like this:

Code: Select all

var repo = GuiRepository.Instance;

The repo "GuiRepository" is located in a Project "Repo", the UserCodeCollection in Project "Code". Within "Code" there is a link to "GuiRepository" in "Repo". I understand I don't need an additional "Reference" for this because the link?

Compiling the solution I get "The name 'GuiRepository' does not exist in the current context (CS0103)"

What's wrong with my approach?

Thanks, Rainer

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3938
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Referencing Repository within User Code

Post by odklizec » Thu Jan 12, 2017 2:54 pm

Hi,

Correct referencing of Ranorex repository in code modules should look like this:

Code: Select all

private static SolutionName.SolutionNameRepository repo = SolutionName.SolutionNameRepository.Instance;
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration