Loop - introducing a pause on each iteration

Hello experts,
I am new to Katalon and was just using the firefox add-in Katalon recorder for some repetitive data download on a website. I introduced a loop within these Katalon recorder steps and exported the codes as below. Unfortunately, I am facing several problems with my code.

First of all, they are executing very fast on the web browser (causing it to issue an error message) and I would like to introduce a wait time to slow each of the 50 iterations of the loop but I am not clear how to do this (which Katalon recorder command should I use for this and where in the codes below would the wait code enter?)

Second, I need to tell the database to extract a certain number of observations (e.g. for one type of download, I am limited to 47619 observations at any one time - hence the need for a loop to do this as I have to extract about 6 millions observations and I need to repeat this about 200 times). Thus, there are two fields on that form (a from: and a to: field) as follows:

from: 1 to: 47619
from: 47620 to: 95238
from: 95239 to: 142857
and so on…

On Katalon recorder, I entered the following for the from: and to: fields:




I am not clear though if my codes are really capturing the gist of how I want the counter to increment and get the correct from: and to: fields filled.

Grateful for any suggestions on this. Codes follow below.

Thank you and regards,

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 com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.thoughtworks.selenium.Selenium
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.WebDriver
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium
import static org.junit.Assert.*
import java.util.regex.Pattern
import static org.apache.commons.lang3.StringUtils.join

def driver = DriverFactory.getWebDriver()
String baseUrl = “https://www.google.com/
selenium = new WebDriverBackedSelenium(driver, baseUrl)
String i = “1”
selenium.type(“id=component_FileName”, “$fr_bs_ltl17_” + i)
selenium.select(“id=component_RangeOptionSelectedId”, “label=A range of companies”)
selenium.type(“name=component.From”, “((” + i + “-1)*47619)+1”)
selenium.type(“name=component.To”, i + “*47619”)
String = selenium.getEval(i + “+1”)

Hi all,
I have found the solutions to my problems. Basically, while following through the Katalon recorder steps, I have introduced pause commands at all steps where I want a pause within the loop. In terms of executing the loop, my counter index was wrongly coded and therefore I . I fixed this by defining i, a, b and ensured a and b are evaluated to the number I want them to be prior to being entered into the “from:” and “to:” fields when the codes execute.

Thank you all for taking the time to read my post.