Page 1 of 1

Unbound variable warning

Posted: Wed Oct 31, 2012 5:23 am
by bsing
Hi there,

I have a test case that has an "Unbound variable" and is flagged as a warning.

I'm not sure how to remove this unbound variable as the test case has no datasource.

Is there a way of removing this unbound variable?

See attached snapshots.

Brad.

Re: Unbound variable warning

Posted: Wed Oct 31, 2012 3:32 pm
by Support Team
Hi,

Currently not but I already added this feature request, see the following forum post: Unbound variables.

Regards,
Markus

Re: Unbound variable warning

Posted: Wed Oct 31, 2012 11:43 pm
by bsing
thanks Marcus.

Re: Unbound variable warning

Posted: Thu Nov 01, 2012 1:43 pm
by krstcs
Bsing,

You could also add a global parameter to your test suite (like "UNMAPPED_VAR") and bind any unmapped variables to it.

In your test suite,
1. Right click the top-level test suite name.
2. Select "Global Parameters".
3. Add the parameter to the list.
4. Click 'OK'.
5. Right click the desired test or test case.
6. Select "Data Binding".
7. Map the parameter from 3. above to any test variables that you don't want to see warnings for.
8. Click OK.

Hope this helps! :D

Re: Unbound variable warning

Posted: Mon Feb 25, 2013 5:09 am
by bsing
Has this defect been fixed yet? I have download the latest Ranorex (4.0.2) and am still getting warnings in the reports for unbound variables.

Re: Unbound variable warning

Posted: Mon Feb 25, 2013 5:10 pm
by krstcs
I do not believe that what you are referring to is actually a defect, but is instead a design decision. You want that warning so you know if things aren't being mapped when they should be.

My suggestions:

1. If you have a variable that isn't being mapped because it isn't needed, you should remove it from the test module.

2. If you need the variable in the module then you can use the process that I posted originally to map the variable to a global parameter that isn't used. That will avoid the warning.

Re: Unbound variable warning

Posted: Tue Feb 26, 2013 12:17 am
by bsing
Yes ... you are correct. I wasn't sure how to remove unwanted module variables ... but worked it out.

Thanks :D

Brad.

Re: Unbound variable warning

Posted: Tue Feb 26, 2013 12:33 am
by bsing
On further investigation only the unused module variables are able to be removed.

I still get "Unbound varables" even when they are being used.

Re: Unbound variable warning

Posted: Tue Feb 26, 2013 5:04 pm
by Support Team
Hello,

The message "Unbound variables" will be shown in your test suite if there is at least one variable, which is not bound to a Data Source. There is no difference between a used or an unused variable. As krstcs said this is a design decision.

Regards,
Bernhard

Re: Unbound variable warning

Posted: Fri Sep 04, 2015 7:12 am
by sandamal
Hi , Im using Ranorex 5.2.2xxx

Can some one tell me the steps to delete a module variable.
couldn't find it :|

Re: Unbound variable warning

Posted: Fri Sep 04, 2015 7:19 am
by odklizec
Hi,

You can delete module variables via Edit Variables dialog. But it's possible to delete only "not used" variables! In other words, if you want to delete a module variable, you first need to remove all references of the variable from recording and/or user code. Once done, variable is set as "Not in use" and only then you can delete it.
DeleteVars.png

Re: Unbound variable warning

Posted: Tue Apr 04, 2017 5:00 pm
by RX-User007
I have a testcase with a module with 2 variables that worked fine. After adding a second recording module in the same test case with two additional (different) local variables, I notice that each time I bind the two variables in module 2, the ones in the other recording become unbound?! And when I bind the ones in recording 1, the two variables in recording 2 become unbound. Pardon my French, but this is annoying me a lot, help appreciated.

Re: Unbound variable warning

Posted: Tue Apr 04, 2017 5:38 pm
by RX-User007
Ok, I got it, one datafile per test case. Hurray for myself? :-)