Page 1 of 1

Using methods with parameters from the User Code Library

Posted: Wed May 22, 2019 10:31 am
by shamann
Hello,

I've been trying to add a method to my User Code Library. I could use it in a recording when it didn't have parameters, but when I added parameters, I could find the method anymore.

Like this. It doesn't appear in my UserCodeCollection anymore:

Code: Select all

 [UserCodeMethod]
 public void foo(RepoItemInfo inputtagInfo){  }
It does work when I remove the parameters though (which unfortunately doesn't meet my needs):

Code: Select all

 [UserCodeMethod]
 public void foo() {  }
Is there a possibility to achieve using that method without copying it to every Recording Module?

Thanks in advance,
Stephan

Re: Using methods with parameters from the User Code Library

Posted: Wed May 22, 2019 11:02 am
by McTurtle
Hi shamann,

In order to use RepoItemInfo, you need to add the "using Ranorex.Core.Repository;" namespace to the User Code Collection.
UserCodeCollectio.png
Have you done that?

Regards,
McTurtle

Re: Using methods with parameters from the User Code Library

Posted: Wed May 22, 2019 11:09 am
by shamann
Hi McTurtle,

It worked. Thanks!