Is it possible to Call UserCodeItem with parameters ?

Ranorex Spy, Recorder, and Studio.
Patrik
Posts: 17
Joined: Fri Sep 02, 2011 2:56 pm

Is it possible to Call UserCodeItem with parameters ?

Post by Patrik » Fri Sep 02, 2011 3:11 pm

Hello,

is it somehow possible to call a UserCodeItem with parameters ?

For example, i have written a timer as an UserCodeItem... Now i want to start and stop the timer at different positions in the same the RecordingModule. I want to call my timer function with on parameter (name of the timer) - but i haven't fount a way to do this yet.

I need somthing like the Action "RunApplication" where i can enter arguments in the column:
usercode.JPG
Screenshot
usercode.JPG (16.57 KiB) Viewed 1058 times
Thanks and best regards,
Patrik

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

Re: Is it possible to Call UserCodeItem with parameters ?

Post by Support Team » Fri Sep 02, 2011 4:56 pm

Hi,

this feature request is on our road-map already and will be available in one of our future releases.

Kind regards,
Tobias
Support Team
.
Image

Patrik
Posts: 17
Joined: Fri Sep 02, 2011 2:56 pm

Re: Is it possible to Call UserCodeItem with parameters ?

Post by Patrik » Mon Sep 05, 2011 8:10 am

Hello Tobias,
thanks for information - sounds good :)
Best regards.
Patrik

PeterM
Posts: 9
Joined: Mon Jan 16, 2012 11:52 am

Re: Is it possible to Call UserCodeItem with parameters ?

Post by PeterM » Mon Jan 16, 2012 12:06 pm

Hello,

I currently have the 3.0.5 version installed, but I cannot see this feature.
Looked through the release notes, but couldn't find this in later versions neither.
Is there a way to call the user code with parameter(s) or is it not imlpemented yet?

Many thanks in advance
Peter

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

Re: Is it possible to Call UserCodeItem with parameters ?

Post by Support Team » Mon Jan 16, 2012 5:55 pm

PeterM wrote:Is there a way to call the user code with parameter(s) or is it not imlpemented yet?
Sorry, this feature is still not available, since unfortunately it is a little more complicated to implement than it may look like :? However, it is still on our wanted-features list and we are currently evaluating, how we can make this feature fit best into the current Ranorex infrastructure.

Alternatively, you can meanwhile achieve a similar functionality by using variables and binding these variables to parameter. See following section in the Ranorex User Guide for more information:
http://www.ranorex.com/support/user-gui ... html#c2985

Regards,
Alex
Ranorex Team
.
Image

PeterM
Posts: 9
Joined: Mon Jan 16, 2012 11:52 am

Re: Is it possible to Call UserCodeItem with parameters ?

Post by PeterM » Tue Jan 17, 2012 11:26 am

Hi Alex,

Thanks for the reply. I read the article you referenced, but not sure how it would do the trick, so if you have some more info on that, I'd appreciate it.
Anyway, will try to get around it ;).

Thanks
Peter

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

Re: Is it possible to Call UserCodeItem with parameters ?

Post by Support Team » Tue Jan 17, 2012 3:48 pm

Hi,

As workaround you have to create a global parameter with the value you wanted to assign to the User Code method, and a Module Variable.
Now you have to bind the global parameter to the specific module variable, because you have access to the module variable through your User Code method.
This enables you to get the value from the global parameter via the module variable.

Regards,
Markus
Ranorex Support Team
.
Image