Hello, i have a custom keyword as shown below:
class start_app {
/**
Launch application and verify page load successfully
*/
@Keyword
def launchApp() {def var_forbidden = findTestObject(‘scr_assertionConsumer/h1_Forbidden’)
def var_serviceTempUnavailable = findTestObject(‘scr_assertionConsumer/h1_Service Temporarily Unavailable’)try {
WebUI.openBrowser(GlobalVariable.var_launchApp)
if (WebUI.waitForElementVisible(var_forbidden, 1, FailureHandling.OPTIONAL) || WebUI.waitForElementVisible(var_serviceTempUnavailable, 1, FailureHandling.OPTIONAL)) {
throw new StepErrorException(‘Access Forbidden!’)
}
}
catch (StepErrorException e) {
WebUI.closeBrowser(FailureHandling.STOP_ON_FAILURE)
KeywordUtil.markFailedAndStop(‘Error message is shown, because you have not configure your IPs !!’)
}
}
}
In some testcases, the GlobalVariable.var_launchApp need to change to GlobalVariable.var_launchAppWSFed_0.
How can i used the same custom keyword and only change the parameter when creating the testcases where it will used the second variable?