Status: New
Owner: ----
Labels: Type-Enhancement Priority-Medium

New issue 1728 by saku.chy...@gmail.com: New variable scope: Child Suite Variable
http://code.google.com/p/robotframework/issues/detail?id=1728

### Example 1. ###

Consider a suite hierarchy as follows:
test
test/__init__.robot
test/1
test/1/__init__.robot
test/1/a
test/1/a/__init__.robot
test/1/a/test_a.robot

Currently only way for test_a.robot to get variables for parent initializations, is that the parents set the variables as global. Same stands even for the upmost test/1/a/__init__.robot file which is at the same level as the test/1/a/test_a.robot suite.


### Example 2. ###

Consider another hierarchy:
test
test/1
test/1/a
test/1/a/__init__.robot
test/1/a/test_a.robot
test/1/b
test/1/b/test_b.robot

Now that only way for test/1/a/test_a.robot to get the initialization data from test/1/a/__init__.robot is by global variables, those are visible also in the b suite test/1/b/test_b.robot. This brings further problems like: the ***Variables*** table in the test suite B cannot override any of the global variables set by suite A.


### Possible solution ###
There would be a need for a new variable scope, called e.g. "Child Suite Variable" that would expose the variables only to the child suites. In practice it would mean that

in example 1.:
Any variable set as "Child Suite Variable" in any of the 3 __init__ files would be visible in the actual tests in the test/1/a/test_a.robot.

in example 2.:
The variables set in suite A __init__ would not be visible to suite B in any way.


Attached an example using pybot.

BR.
-sac-

Attachments:
        robot_globals_not_overridden_by_testcase_vars.tgz  521 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to