Compare one value again list of values(which changes every minute)

My requirement is that

  1. i have one name
  2. in the name page that name is to be compared against list of few more names. if there is a match then i need to click on that name and perform actions.
    PROBLEM:
    the names in the list gets refreshed every minute (i.e , the name which is first now may be refreshed and change its position next) and so does the ID(ID which we get when we inspect the element, dynamic value)of the value(in this case name).
    Can someone help out please.

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.