Retrieve parent variable during runtime

Ask general questions here.
kmng
Posts: 1
Joined: Wed Jun 08, 2016 5:10 pm

Retrieve parent variable during runtime

Post by kmng » Wed Jun 08, 2016 5:28 pm

I just wondering is that a way to get value that was assign to a variable during runtime? And if my project structure is on the same level, it will not have any issues at all, however below are my project structure -

=====================================
Test Suit
-Country
--Data Entry
---Product A [Data Binding using EXCEL]
----Sub Product A.1
-----Recording Module A.1.1
------[Start]
------Delay()
------Log (var_Product) - value was assign via EXCEL
------and etc.......
------CustomerFunction(Country, Function) -> Refer to genetic BaseCommon()
------[End]
-----Recording Module A.1.2
-----Recording Module A.1.3
----Sub Product A.2
======================================

And eventually BaseCommon(), refer to a customized individual sub CodeModule()
In one of the CodeModule(), i was trying to access a variable located inside [Recording Module A.1.1] let say var_Product.... How can i do that?

I have try many ways, but still not able to.....
Please advice...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Retrieve parent variable during runtime

Post by Support Team » Thu Jun 09, 2016 2:17 pm

Hi kmng,

Basically, you just need to create a test case parameter for each variable you want to share between your modules and bind this parameter to the desired module variables. A short tutorial that describes the complete process of sharing data between modules can be found in the corresponding blog entry.

If you want to share data between two test cases, you could either use a global parameter or create a test case parameter for the parent test case.

I hope this information will help you.

Sincerely,
Johannes