I have a Test case which i can reuse many times if I pass one variable to it.
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.