Hi @grylion54, thank you for the advice and tips. I will explore the parametrization later. In the meantime am thankful that your ealier solution has helped to fix the issue. Am actually beginner level.
If else and variable - Product Forums / Katalon Studio - Katalon Community
Here’s my revised script that is working fine now. The respective buttons are clicked when condition is met.
// Fetching price value from eTravel_TestData.xlsx, fulfil condition, respective button will be clicked
if (findTestData('eTravel_TestData').getValue(3, rowNum) == "100") {
WebUI.waitForElementClickable(findTestObject('DataDrivenTest eTravel/Page_Company/span_100.00'),
5)
WebUI.click(findTestObject('Object Repository/DataDrivenTest eTravel/Page_Company/span_100.00'))
} else if (findTestData('eTravel_TestData').getValue(3, rowNum) == "200") {
WebUI.waitForElementClickable(findTestObject('DataDrivenTest eTravel/Page_Company/span_200.00'),
5)
WebUI.click(findTestObject('Object Repository/DataDrivenTest eTravel/Page_Company/span_200.00'))
} else if (findTestData('eTravel_TestData').getValue(3, rowNum) == "300") {
WebUI.waitForElementClickable(findTestObject('DataDrivenTest eTravel/Page_Company/span_300.00'),
5)
WebUI.click(findTestObject('Object Repository/DataDrivenTest eTravel/Page_Company/span_300.00'))
}
Thank you so very much
![]()