Reusing a test case - Passing variable to a test case while running a test suite

I have a Test case which i can reuse many times if I pass one variable to it.
image

The variable select_dashboard alone changes which I need to pass to the custom keyword I created as shown below :

private static void verifyViewChanges(TestObject db){
KeywordUtil.logInfo("Inside method —> verifyViewChanges ")
WebUI.click(findTestObject(‘Intentwise/Overview/Overview_TrendChart/view_changes_slider’))
WebUI.verifyElementAttributeValue(findTestObject(‘Intentwise/Overview/Overview_TrendChart/viewChanges’), ‘aria-checked’,
‘true’, 10)
WebUI.click(findTestObject(‘Intentwise/Overview/Overview_TrendChart/viewChangesNumber’))
WebUI.verifyElementText(findTestObject(‘Intentwise/Overview/Overview_TrendChart/redirectToDB’), ‘Change History’)
WebUI.click(db)
WebUI.verifyElementAttributeValue(findTestObject(‘Intentwise/Overview/Overview_TrendChart/viewChanges’), ‘aria-checked’,
‘false’, 10)
}

I need to use this test case in different test suites , and in each test suite the value for “select_dashboard” variable changes.

Is there a way to achieve this ? Can I reuse this test case in multiple test suites by only changing the value of the variable with respect to test suite?
Kindly please guide me on this.

@duyluong @kazurayam @Russ_Thomas Kindly Please share your suggestions

this may help:

1 Like

@yashaswini.sadananda

If each test suite has a different value for select_dashboard, then I recommend putting it into a global profile. Then in a Test Suite Collection you can add the Test Suites and choose the respective profiles.

1 Like