Our web UI has unique custom automation ids for each element (buttons, labels, ...). I do not have access to normal ids of elements.
<button custom-id='send' class='dynamic_class_123'>
How can I access the element in a best practice manner? Right now I use the following locator
@FindBy(xpath = "//button[@custom-id='send']")
public WebElement sendButton;
The automation code will break once the dev is converting the button to a div element. I would not have this problem with normal ids:
@FindBy(id = "send")
public WebElement sendButton;
It would find the element regardless of type (button, span, div, ...).
Is there a way I can achieve same result with my custom ids without the need of xpath or at least a improved version of it?