Verifying two object that change according to the order item that user inputted

Hello community member, have a question :

How do we verify match two object that always changed according to user input when we do mobile testing ??

The case :
This is the mobile payment application
I have two page, I want to verify that the total bill in the left page is similar to total bill in the right page.
At first the test case that I created successfully automated the steps until finished.

But, problem arised when I add an order item to the application,
and the object changed (because adding order change the total bill). When I try to automated the steps again,
the steps failed and katalon gives the error message “Root cause: com.kms.katalon…Objectelement not found”

This is the snippet code that I use to store both values on string and verifymatch those values:

//store total_payment (value on left page) to string

def total_payment = Mobile.getText(findTestObject(‘ObjectRepistory/MKioskNewRepo/totalpayment’),10,FailureHandling.STOP_ON_FAILURE)

//tap “Bayar” button (pay button) and open the right page

Mobile.tap(findTestObject(‘Object Repository/MKioskNewRepo/bayarbill’),0,FailureHandling.STOP_ON_FAILURE)

//store total_bill (value on right page) to string

def total_bill = Mobile.getText(findTestObject('ObjectRepistory/MKioskNewRepo/totalbilling),10,FailureHandling.STOP_ON_FAILURE)

The code above works when I didn’t add new item that cause the price on the left page and right page to change… but when I add new item , the code didn’t work anymore and katalon gives me “object not found”. So the question is "how do I still successfully automate the app when I change the price by adding new item each time I run the test automation ? "

Please read this post and respond accordingly: