How to create global method of user code

Ranorex Studio, Spy, Recorder, and Driver.
derko
Posts: 3
Joined: Wed Jul 04, 2012 9:41 am

How to create global method of user code

Post by derko » Wed Jul 04, 2012 10:10 am

Hello,

I need to create global method of user code that I can use within every recording module. It should look like this: Add New Action -> User Code -> choose my method. Is it possible?

Thank you.

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

Re: How to create global method of user code

Post by Support Team » Wed Jul 04, 2012 1:05 pm

Hello,

You can for instance create a C# Class with your method and call this method in each of your UserCode actions method.
You unfortunately can't directly call a method from another recording in your action table.

Regards,
Markus
Ranorex Support Team

swmatisa
Posts: 123
Joined: Fri Aug 05, 2011 7:52 am

Re: How to create global method of user code

Post by swmatisa » Wed Jul 04, 2012 1:21 pm

Hello,

I thing you can do this like explained in http://www.ranorex.com/forum/ghost-function-t3515.html
SW

derko
Posts: 3
Joined: Wed Jul 04, 2012 9:41 am

Re: How to create global method of user code

Post by derko » Wed Jul 04, 2012 1:27 pm

Thanks for your answer,

I found another simple way to resolve my problem. When I copying User Code line from action table to another recording module, all user code automatically copying in this module.

Regards,
Dmitry

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

Re: How to create global method of user code

Post by Support Team » Wed Jul 04, 2012 1:46 pm

Hi,

Right, forgot the way with the base class :oops:.
Thanks serge for the suggestion :D .

Regards,
Markus
Ranorex Support Team