Hi all,
I will try to keep this as brief as possible. With as much detail as I can.
Scenario
I
am running a very simple test suite that will check multiple URL’s.
Some of these URL’s have a prefix of https, others have a prefix of www.
They all lead to the same site but I need to test that the sites are
all up and running.
Currently, I have it set like this;
WebUI.openBrowser(’’)
WebUI.maximizeWindow()
WebUI.navigateToUrl(‘https://website.com’)
CheckDefaultLanguage = WebUI.waitForElementAttributeValue(findTestObject(‘Check For English/Language_Select’), ‘Value’,
‘English’, 3)
if (CheckDefaultLanguage == false) {
WebUI.click(findTestObject(‘Check For English/input_ddlLanguage’))
WebUI.click(findTestObject('Check For English/td_English'))
}
WebUI.verifyTextPresent(‘Business Management Centre’, true)
WebUI.navigateToUrl(‘http://website.com’)
CheckDefaultLanguage = WebUI.waitForElementAttributeValue(findTestObject(‘Check For English/Language_Select’), ‘Value’,
‘English’, 3)
if (CheckDefaultLanguage == false) {
WebUI.click(findTestObject(‘Check For English/input_ddlLanguage’))
WebUI.click(findTestObject('Check For English/td_English'))
}
WebUI.verifyTextPresent(‘Business Management Centre’, true)
WebUI.navigateToUrl(‘http://www.website.com’)
CheckDefaultLanguage = WebUI.waitForElementAttributeValue(findTestObject(‘Check For English/Language_Select’), ‘Value’,
‘English’, 3)
if (CheckDefaultLanguage == false) {
WebUI.click(findTestObject(‘Check For English/input_ddlLanguage’))
WebUI.click(findTestObject('Check For English/td_English'))
}
WebUI.verifyTextPresent(‘Business Management Centre’, true)
WebUI.closeBrowser()
However,
it has come to my attention that the above is a very set way of dealing
with this and we are looking to move our servers to the cloud,
therefore, this test needs to be used more.
Requirement
I
need to make it so that, either in the test case or test suite, the
prefix to the URL (www. or https etc.), is changed 4 times before moving
on to the next case, or closing the browser.
Is there
any way of getting Katalon to run through multiple variables, through
something like a data file? I just want to try and make this test as
flexible as possible.
Any questions please ask.
TL;DR: I want a variable that changes 4 times before the test case finishes, changing the start of a URL each time.