How to get all the values in a table

In selenium I was able to all avlues using findelements
But in katalon there is no method like findelelements
Is there anyway we can get all values

Create your own keyword, for example: yourTestpackage.findAllElements(String classname)
@Keyword
def findAllElements(String classname){
def driver = DriverFactory.getWebDriver()
return driver.findElements(ByClassName.className(className))
}

package to inherit them

can anybody let me know the package to inherit the above code

hello @Russ_Thomas @kazurayam
im stuck with a doubt in a particular concept and it would be really helpfull if u guys help me out.!
the thing is that, we guys want to use FindAll and FindBys annotations in our katalon scripts, like it can be used in the other autamation tool but, im not understating how to implement these two annotation to our katalon scripts. please try to reach out ASAP
Question to be clarified:-

  1. Can we use FindAll and FindBys annotations in katalon Studio?
    2)If yes, then how can we use these two annonations?
    3)if no, then is there any other way so that i can select a particular web element making use of multiple locators?
    Thamks a ton in advance and i will be waiting for the reply…!! thank you soo much…!! peace!!

I don’t think you can.

You might be able to re-invent FindAll and FindBys for Katalon Studio as custom keywords. That would be tough.

To me, FindAll and FindBys look very advanced feature of Selenium. That is not for automation-beginner. I think, Katalon Studio does not address it.

If you seriously wanting FindAll and FindBys, possibly you should stay on your automation tool of your choice.

1 Like

thank you for your responce mate @kazurayam…!! Cheers…!!

select a particular web element making use of multiple locators?

I can do it with XPath. For example, this code:

@FindBys( {
   @FindBy(className = "class1")
   @FindBy(className = "class2")
} )

is semantically equivalent to a single XPath expression like this:

//*[contains(@class,"class1") and contains(@class,"class2")]

One more example.

@FindAll({
   @FindBy(className = "class1")
   @FindBy(className = "class2")
})

is semantically equivalent to a single XPath expression like this:

//*[contains(@class,"class1")] | //*[contains(@class,"class2")]

As you know, the Test Object of Katalon Studio enables you to utilize XPath. So, you do not need @FindAll and@FindBys in Katalon Studio.

Here is a good tutorial of XPath:

As this tutorial shows, browser’s Dev Tool supports XPath very well. You can debug XPath expressions with Google Chrome’s Dev Tool. I am not sure how much @FindAll and @FindBy annotations are easy to debug — likely there is little of Tool support.

Here I presented examples using XPath. But I am sure you can make equivalents using CSS Selector as well.

1 Like

@kazurayam thank you soo much…!!