Dynamically Setting Variables?

Ranorex Spy, Recorder, and Studio.
chowdhury_a
Posts: 5
Joined: Tue Mar 13, 2012 7:32 pm

Dynamically Setting Variables?

Post by chowdhury_a » Tue Mar 13, 2012 7:46 pm

Hello,

I'd like to set variables based upon attribute values found by my tests. How can this be done?

Thanks,
AC

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

Re: Dynamically Setting Variables?

Post by Support Team » Wed Mar 14, 2012 8:30 am

Hi,

you can simply access the module variables within user code items of your recordings and overwrite them.
If you have e.g. a variable called "$test" in your recording, you can overwrite it by adding a user code item to your recording and adding following line of code to this user code item:
test = "<your value>";
If you'd like to overwrite parameters of your test case please have a look at following forum post which might help you solving your issue:
Global parameters - recordings' variables binding

Regards,
Tobias
Support Team
.
Image