ExecuteScript to Variables

Class library usage, coding and language questions.
Lyuba Boerma
Posts: 35
Joined: Mon Apr 01, 2019 12:12 pm

ExecuteScript to Variables

Post by Lyuba Boerma » Thu Apr 11, 2019 2:57 pm

for my project i need to make a test which simulated Scanning bar-codes .
i need to do a lot of same actions to different items
So my question is....can i convert script value to a variable?

Everything what is inside ( ) make a variable

Code: Select all

for example

Code: Select all


Is it possible??

Thanks for help
script.png (31.12 KiB) Viewed 1079 times

User avatar
Posts: 461
Joined: Fri Jul 15, 2016 1:35 pm

Re: ExecuteScript to Variables

Post by Stub » Fri Apr 12, 2019 7:58 am

You can easily call onto other code from a Code Module. While I have no idea how your code is structured:

Code: Select all

BarcodeListener listener = new BarcodeListener (repo.someItemInfo);
listener.applyBarcode("Blah Blah");
But that probably misses your point since I'm not familiar with this ExecuteScript API.

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

Re: ExecuteScript to Variables

Post by odklizec » Fri Apr 12, 2019 8:58 am


Since the RunExecute script is basically a simple string, you can, of course, use variable as ExecuteScript parameter. If you want to use it in code, you can do it as you suggested in your initial post. You just have to use it in UserCode of selected recording or custom created code module.
ExecuteScriptVar.png (65.33 KiB) Viewed 1045 times
Last edited by odklizec on Fri Apr 12, 2019 2:22 pm, edited 1 time in total.
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

Lyuba Boerma
Posts: 35
Joined: Mon Apr 01, 2019 12:12 pm

Re: ExecuteScript to Variables

Post by Lyuba Boerma » Fri Apr 12, 2019 2:15 pm

Thank you! It is working!))
I Made it with variables, as you showed :D

Posts: 1
Joined: Mon Apr 29, 2019 7:03 am

Re: ExecuteScript to Variables

Post by Unmeshatodkar » Mon Apr 29, 2019 7:05 am

Thanks odklizec, It was valuable answer for me also. Great help!