Not able read list data

Hi All,

We are trying to use list in our code, but it is bringing one record (blank data) instead of complete records (i.e. around 110). Also i am not getting any error in console with the code. Same xpath and code I am able to run and get the correct data in selenium and it is working fine. Can anyone please tell the possible solution for katalon.


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 org.openqa.selenium.WebDriver as WebDriver
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import org.openqa.selenium.By as By
import org.openqa.selenium.WebElement as WebElement
import java.util.List as List
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import 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 internal.GlobalVariable as GlobalVariable

WebUI.callTestCase(findTestCase('Green M1/Classic UI/Header Selection'), [:], FailureHandling.STOP_ON_FAILURE)'Green M1 Classic/HomePageClassic/NewRequestBtnClassic'))

WebDriver driver = DriverFactory.getWebDriver()
List<WebElement> ReqType = driver.findElements(By.xpath("//*[@class='frmLbl vspc dIblock bld']"))
List<WebElement> RDName = driver.findElements(By.xpath("//*[@class='chkLbl']"))

int ReqTypeCount = ReqType.size()
System.out.println('ReqTypeCount is:' + ReqTypeCount)

for (int i = 0; i < ReqTypeCount; i++) {

int RDCount = RDName.size()
System.out.println('Request Definition count is:' + RDCount)

for (int j = 0; j < RDCount; j++) {

    if (RDName.get(j).getText().contains('Test Attachment')) {

Considering that you’re getting one element back (and not getting an empty list), my guess is that you’re not locating the set of elements you are intending to. Can you share the HTML for the element list(s) you are trying to capture?

Will provide soon