I imagine in the future we'll have ML-backed tools to give instructions like "Find the submit button", and that they'll be able to account for A/B testing and other things that get in the way of automation.
The less "smart" way of solving this is to look at the contents of the element like Cypress' `contains` [1].
[0]: https://walrus.ai/
[1]: https://docs.cypress.io/api/commands/contains.html#Syntax