Hi, I’m hoping someone can help me with my query. I have searched for historic posts and i think other people have asked similar questions and i have tried the suggestions made by other experts but i’m still getting issues.
Here is my script:
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
WebUI.openBrowser('')
WebUI.navigateToUrl('<private URL>')
WebUI.setText(findTestObject('Object Repository/Page_Login/input_Login_login'), '<private login>)
WebUI.setEncryptedText(findTestObject('Object Repository/Page_Login/input_Login_password'), '<private password>')
WebUI.sendKeys(findTestObject('Object Repository/Page_Login/input_Login_password'), Keys.chord(Keys.ENTER))
WebUI.selectOptionByValue(findTestObject('Object Repository/Page_<something>/select_Live ModeTest Mode'), '1', true)
WebUI.click(findTestObject('Object Repository/Page_<something>/span_Add Group'))
WebUI.selectOptionByValue(findTestObject('Object Repository/Page_<something>/select_noneOption1Option2'), 'Option2', true)
for (def index : (0..0)) {
WebUI.setText(findTestObject('Object Repository/Page_<something>/input_Tracking Numbers__tracking_number'), tracking_number)
WebUI.sendKeys(findTestObject('Object Repository/Page_Parcel Groups/input_Tracking Numbers__tracking_number'), Keys.chord(
Keys.ENTER))
}
WebUI.click(findTestObject('Object Repository/Page_<something>/span_Submit'))
What i’d like the test case to do is
- Open web page
- Login
- Open a section of the page which will allow multiple inputs
- Loop through some test data (csv)
- Submit data
- Close browser
When i setup a Test Suite with the Test Case and Test Data the browser is opened for each item in the test data, however i need it to keep the browser open and loop through the data and then close the browser.
Is this possible in Katalon?
Thanks!