Feature Request: Add ability to localize/encapsulate data

Ranorex Studio, Spy, Recorder, and Driver.
TestBalloon
Posts: 15
Joined: Thu Mar 03, 2022 9:19 am

Feature Request: Add ability to localize/encapsulate data

Post by TestBalloon » Wed Jul 06, 2022 1:10 pm

Hello,

this topic has bothered me since I started using Ranorex a few years ago.
In programming it is a good practice and in fact mostly automated that variables which you don't need on a global scope are instead local and not visible in the whole program.

Ranorex does this the other way around, as any variable which is exposed in an action will also be visible in the test which contains the module in which the action is contained. I was always wishing for a way to mark a variable in a module as "local" so that it is only valid inside a module and is not visible outside the module. Currently we are binding all variables which should be local to a global variable "Trash" so that it is bound and we don't get an "unbound variables" warning.
An easy example why you need local variables is building a report string in a user action and reporting that string with the report action. It is also neccessary in many other cases (any value builder scenario).

I'd like to have a switch or flag that can be turned on in the module variables dialog (where you also can define default values) and which makes the variable vanish (not offered as an option) from the variable binding dialogs outside the module.

I hope my request was clear enough.

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

Re: Feature Request: Add ability to localize/encapsulate data

Post by odklizec » Wed Jul 06, 2022 1:40 pm

Hi,

A similar feature request has been made multiple times in the past. Sadly, no luck yet. I agree that this problem with "unbound" variables is, at very least, annoying.
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