0

I am testing Android and IOS applications, and i have an issueto get the UID of an element.

When i evaluate the element on Intellij, i have those key and value : Evaluation of element

What i want is to get the value of "id", but i tried a lot of things, and Serenity doesn't know getAttribute("UID") or getAttribute("elementId") or getAttribute("id")

This is what i write for my element : Element declaration

And this the method who use the elementId i need : Methode which use elementId this method works with the actual remote element but i want the Serenity WebElementFacade for some reasons, but it's not compatible with remoteElement

Any idea ? Thanks a lot in advance for your help !

Yoan
  • 1
  • 3

1 Answers1

0

I just answer my question with this code (thanks to github copilot !!! XD )

public static String getWebelementId(WebElementFacade webElementFacade) {
    RemoteWebElement remoteWebElement = (RemoteWebElement) webElementFacade.getWrappedElement();
    return remoteWebElement.getId();
}

if this can help anyone !

Yoan
  • 1
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 23 '23 at 14:07