findElement and findElements not working in Katalon 7.0.7

Hi,
I need to store the list of WebElements in katalon for a WebUI
Please give me some examples
findElement and findElements also not working

Hi @bharathi.a

What do you mean by not working ? Please share some scripts, screenshots and explain more about what you’re trying to do and what hasn’t worked.

List element=WebUI.findWebElements(findTestObject(‘Object Repository/google/h3_Katalon Community’), 2)

i’m trying to get values from a Web table by using a common locator and save them into a list of webelements

but when i print the list it returns empty List only ([])

List elements = WebUiCommonHelper.findWebElements(findTestObject(‘Object Repository/BranchOrder/Page_DMS/Page_DMS/Page_DMS/Page_DMS/Page_DMS/Rows’),
2)

println(elements)

Hi @bharathi.a

Is the locator inside object

findTestObject(Object Repository/BranchOrder/Page_DMS/Page_DMS/Page_DMS/Page_DMS/Page_DMS/Rows’);

able to find an element ? You can just use regular Selenium syntax like this:

DriverFactory.getWebDriver().findElements(By.xpath("the locator inside the Test Object"));

yeah this contains my object
findTestObject(Object Repository/BranchOrder/Page_DMS/Page_DMS/Page_DMS/Page_DMS/Page_DMS/Rows’);

i try with the code into my script but it shows Underline for by.xpath("")

please mention the DriverFactory that you used is from com.katalon from the selenium
it shows 3 different Driver Factory here

Please press Ctrl + Shift + O to auto import the By and relevant statements. You should the last DriverFactory in the image.