Calling User Functions From Compiled Script

Ask general questions here.
hans.dominic
Posts: 12
Joined: Fri Mar 18, 2016 3:06 pm
Location: Norway

Calling User Functions From Compiled Script

Post by hans.dominic » Wed Aug 22, 2018 9:14 am

Hi,

I have scripts (all user codes) and compiled to EXE and each of those scripts has a common user function. Now if I'll be having some changes on that user function, I have to re-compile all those scripts which is really time consuming because there are at least 2K scripts. Can someone give me an idea on how to have a better solution for this?

Thanks in advance for your help.

-- Hans

hans.dominic
Posts: 12
Joined: Fri Mar 18, 2016 3:06 pm
Location: Norway

Re: Calling User Functions From Compiled Script

Post by hans.dominic » Wed Aug 22, 2018 11:00 am

Never mind, just ignore this post. I have just found a solution. Thanks.

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

Re: Calling User Functions From Compiled Script

Post by odklizec » Wed Aug 22, 2018 11:06 am

Hi,

I was about to suggest you to build your custom methods in a dll and reference this dll in all your projects. Then it should be required to rebuild just the dll. Something as described here:
https://www.ranorex.com/blog/organizing ... nOfModules

Anyway, could you please share your solution? I'm sure, it may help other forum members ;)
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

hans.dominic
Posts: 12
Joined: Fri Mar 18, 2016 3:06 pm
Location: Norway

Re: Calling User Functions From Compiled Script

Post by hans.dominic » Wed Aug 22, 2018 11:14 am

Thanks for your suggestion.

Actually it is similar to what you have suggested. I just don't know how to create custom DLLs so I just compiled the project (EXE) which contains all custom methods and reference this to my projects.

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

Re: Calling User Functions From Compiled Script

Post by odklizec » Wed Aug 22, 2018 11:26 am

Hi,

Your solution is basically the same as I suggested ;) Just for future, you can select the type of app in Project settings >> Application tab. Class Library would turn the project to dll...
ClassLibrary.png
ClassLibrary.png (29.08 KiB) Viewed 64 times
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

hans.dominic
Posts: 12
Joined: Fri Mar 18, 2016 3:06 pm
Location: Norway

Re: Calling User Functions From Compiled Script

Post by hans.dominic » Wed Aug 22, 2018 11:46 am

Woow! I didn't know that... This is really what I am looking for. You save my day!

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

Re: Calling User Functions From Compiled Script

Post by odklizec » Wed Aug 22, 2018 12:00 pm

You are welcome ;)
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