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.

Hi @ThanhTo - does WebUI.findWebElements has issue in getting elements? coz your suggesting the latter.

1 Like

Hi,

Thanh has left our Katalon team. To your question, have you tested it with the latest Katalon version?

1 Like

Hi @Elly_Tran we are using 8.6.5 version.

1 Like

I use “WebUI.findWebElements” and have no issue with it using KS 8.6.2. I also use “WebHelper.findWebElements” with no issue.

Guys What’s going on this thread was created in March 2020. After 4 years there is a discussion on this.
I’m so glad.
I got the solution. and I’m good.
Thank you for the reply

1 Like