How i can take dinamic object

hi ppl, I have a number that changes on the web, and I want to verify that it is the same as the number in another part of the web, but when I take the object it takes the number, if the number changes, the test is broken, regardless of whether the 2 numbers are equal, I need to get it to compare that they are equal, regardless of the number that is

Read the following, then post back with some good detail:

You need to collect the numbers when you are on the page when the numbers are visible, like:

def firstValue = WebUI.getText(findTestObject("yourTO"))

or

def firstValue = WebUI.getAttribute(findTestObject("yourTO"), "value")

Note: you will have to determine if it is an element’s Text or Attribute. If you are unsure which one to use, then ask.

Then when the second number is visible on the page, you do similar, like:

def secondValue = WebUI.getText(findTestObject("yourTO2"))

or

def secondValue = WebUI.getAttribute(findTestObject("yourTO2"), "value")

And then you compare the two values, like:

WebUI.verifyMatch(firstValue, secondValue, false)

or

WebUI.verifyEqual(firstValue, secondValue)

or

assert firstValue == secondValue

I will let you play with that.