Find Elements that have same class/id

Hi,
I am evaluating Katalon to automate one of our mobile apps.
The app is used for backing up files on a mobile.
The app shows list of files/folders backed up, I want to write a test to verify that all files are backed up.

IS there FindElements method, which will return array of elements with specific class/id. Then I can easily parse the array for verification.

Regards,
Shubhangi

2 Likes

Shubhangi said:

Hi,

I am evaluating Katalon to automate one of our mobile apps.

The app is used for backing up files on a mobile.

The app shows list of files/folders backed up, I want to write a test to verify that all files are backed up.

IS there FindElements method, which will return array of elements with specific class/id. Then I can easily parse the array for verification.

Regards,

Shubhangi

Hi,

I’m having the same issue. Did you find a way to do this?

What if use 2 different search
list_Id findElements(By.id …
list_class findElements(By.className …

than merge lists

List<String> newList = new ArrayList<String>(list_Id);newList.addAll(list_class);

I have more than one elements with the id. How to get them all to a list and i want to verify each of the element in that list.
i was trying something like this and it is not working

List el = new ArrayList();

el= addAll(findTestObject(‘FourStarHotel/Page_Search Results/list_Hotel’))

Sorry - probably will not work on mobile … (did not notice that tis is in mobile section)
Hello,
how about this:

import org.openqa.selenium.Byimport org.openqa.selenium.WebDriverimport com.kms.katalon.core.webui.driver.DriverFactoryimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUIWebUI.openBrowser('http://forum.katalon.com/discussion/3969/find-elements-that-have-same-class-id')WebDriver driver = DriverFactory.getWebDriver();def elements = driver.findElements(By.xpath('//li[contains(@class,"ItemComment") and contains(@id,"Comment")]'))println elements.size()