I want to contains any element array of another array

i want to contains two arrays elements, but this code does not work. what i can to do?

List<WebElements> elements = DriverFactory.getWebDriver().findElements(By.xpath("//div[@class='sc-bdVaJa sc-gZMcBi cWqTYD']"))
List<WebElements> ibans = DriverFactory.getWebDriver().findElements(By.xpath("//div[@class='sc-bdVaJa sc-bwzfXH cUWysv']"))
 def cardsNumUI = []
 def ibanArray = []
 def cardsNumDB = []
 //Get and print from UI
 for(int i = 0; i < elements.size(); i++) {
	 def text = elements[i].getText()
	 println text
	 cardsNumUI << text
	 def ibantxt = ibans[i].getText()
	 println ibantxt
	 ibanArray << ibantxt
	 //Get account names from DB and print
	 Database_Cards model = AccountDataService.countCards(ibanArray[i])
	 def count = model.countCards
	 println count
	 cardsNumDB << count

 println "Iban List:" + ibanArray
 println "Count Cards From DB: " + cardsNumDB
 println "Count Cards From UI: " + cardsNumUI
  if(cardsNumDB.size() == cardsNumUI.size()){
	 KeywordUtil.logInfo("Array size - OK")
 else {
	 KeywordUtil.logInfo("Array size - Error")

 if (cardsNumDB.containsAll(cardsNumUI)) {
	 println cardsNumDB + "=" + cardsNumUI
	 KeywordUtil.logInfo("It's OK - UI Objects are Same DB")
 else {
	 println cardsNumDB + "!=" + cardsNumUI
	 KeywordUtil.logInfo("UI Objects are NOT Same DB")

These are not arrays, they are Lists:

List<WebElements> elements = DriverFactory.getWebDriver().findElements(By.xpath("//div[@class='sc-bdVaJa sc-gZMcBi cWqTYD']"))

List<;WebElements> ibans = DriverFactory.getWebDriver().findElements(By.xpath("//div[@class='sc-bdVaJa sc-bwzfXH cUWysv']"))

So in your code, you cannot do this:


You should instead do:


elements getting is working. at this moment no problem with elements[i].getText()
The problem is only compare cardsNumDB array to cardsNumUI array

So i find solution and it was solved now.
cardsNumDB << count.toString()
It seems cardsNumDB is an Integer
but cardsNumUI is an String
So when i compare integer to string, it was displayed error. now it solved