Hi @shweta.bhardwaj
Screenshots would help. I am still not sure of what the requirement is.
i have saved the name of donor in string S.
Now I have to match this donor name ie. S , against 20 other donors ( this list is not fixed, gets refreshed every minute, so the order in which the donor names appears changes too with every refresh).
how to code this in katalon?
Get all names from page into a list
Call contains() method on that list.
TestObject’s selector must match all rows in your list.
List<WebElement> wes = WebUiCommonHelper.findWebElements(testobject, 0)
List<String> names = new ArrayList()
for(WebElement we in wes) {
names.add(we.getText())
}
assert names.contains("John Doe")
Thanks for your suggestions @Marek_Melocik , The name(STRING ‘S’ - in my case) is auto generated I do not pick the name. the code that you are suggesting looks like will be fixed for one specific donor.
Well, where does it come from? It is just a sample code, you can parametrize the name.
it is coming from a form/ table.
I was thinking that , there will be a new donor every time and this new donor name will be compared against the donor list.
so as per the change in the donor name, how do i do that in katalon.
So just get donor’s name from table, save it in a variable and use it in contains method.
1 Like
let me try. if that works.