# Test Suite - Script Mode - set up method - how to pass common data value

**URL:** <https://forum.katalon.com/t/test-suite-script-mode-set-up-method-how-to-pass-common-data-value/28144>\
**Category:** Miscellaneous\
**Tags:** katalon-studio\
**Created:** [June 19, 2019, 5:10am UTC](https://forum.katalon.com/t/test-suite-script-mode-set-up-method-how-to-pass-common-data-value/28144 "2019-06-19T05:10:59Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [June 19, 2019, 7:32am UTC](https://forum.katalon.com/t/test-suite-script-mode-set-up-method-how-to-pass-common-data-value/28144/5 "2019-06-19T07:32:26Z")

</div>

How many pairs of (company, menu) do you have? 1? or many?

If many, do you want to iterate over the all pairs?

If you want to iterate over the all pairs of (company, menu), the def setUp() method of a Test Suite would not be appropriate place where you perform that iteration.

* * *

If I am to implement this, I would rather add a new test case named “Controller” where I would write the following lines:

```auto
/**
 * Test Cases/Controller
 */
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import com.kms.katalon.core.testData.TestData

TestData companyList = TestDataFactory.findTestData("data1/Company")
for (int i = 1; i < companyList.getRowNumbers(); i++) {
    def name = companyList.getValue("name", i).trim()
    def menu = companyList.getValue("menu", i).trim()
    // call common setup scripts
    WebUI.callTestCase(findTestCase(‘Home/searchCompany’),[(‘testCompany’) : name],
         FailureHandling.STOP_ON_FAILURE)
    WebUI.callTestCase(findTestCase(‘Menu/NavigateToMenu’), [(‘menuPath’) : menu],
        FailureHandling.STOP_ON_FAILURE)
    // and call other business scripts
    WebUI.callTestCase(findTestCase(....
    WebUI.callTestCase(findTestCase(....
}

```

And your test suite calls the “Controller” testcase only. Its @SetUp method has nothing to do.

---

_[View the full topic](https://forum.katalon.com/t/test-suite-script-mode-set-up-method-how-to-pass-common-data-value/28144)._
