How to send variable inside a data binding

Best practices, code snippets for common functionality, examples, and guidelines.
GranPapi
Posts: 5
Joined: Mon Jul 25, 2016 6:33 pm

How to send variable inside a data binding

Post by GranPapi » Tue Aug 16, 2016 6:42 pm

Hey guys! How you doing? Need a little bit of your help.

I've created a module that stores a value in a variable called "fileFullName" (it's a global variable), and I want to use the value stored in that variable inside another module; however, when I do the binding, I'd like to use the variable as shown in the attached screenshot (highlighted in red), but Ranorex sends the value as it's written

How can I make Ranorex to use the value stored inside my variable?

Thanks in advance!
Attachments
quest1.png
quest1.png (65.14 KiB) Viewed 624 times

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to send variable inside a data binding

Post by krstcs » Tue Aug 16, 2016 7:02 pm

The value you enter in that field is the default STRING value of the global parameter. You cannot put other variable names there as they will NOT BE EVALUATED. This value will be passed just as it is written. Consider it the DEFAULT VALUE of the parameter if you don't pass in a value from the command-line, or change it in a module.

If you want to change the value of a parameter, you need to bind it to a module variable. Then, in that module, you need to get the value you want and store it in the module variable. This will automatically update the global parameter's value as well, since they are bound.

You would then bind the parameter to your OTHER module's variable to use the new value.


As I said in your other post, please read the user guide as it contains all of this information. In addition, go through the example blog posts and videos on this site.
Shortcuts usually aren't...