.click() is not working

I am testing an iOS application with appium2 for the first time, when I run
const elementId = await driver.$(’//*[@text=“MY ELEMENT”]’).click();
I have the error : TypeError: elementId.click is not a function

I checked that the xPath was correct via AppiumStudio, it’s the same xPath for the following platforms: android / iOS in web (mobile and desktop), The click works only for android in native.

What am I doing wrong?

Hello, I have helped to troubleshoot in real, to give more insight, MY ELEMENT is in his script Tout accepter

The selector await driver.$(’//*[@text=“Tout accepter”]’) doesn’t return anything, despite Appium studio when we click on COPY X PATH is the same.

I asked him to update post and add a screenshot of appium studio and whole script, but everything was correct, the only weird thing is that there is some Path that contains Tout accepter but are not equal.

We also tried await driver.findElement('accessibility id', 'Tout accepter');

I have no clue yet why this is not working.

This should be another question but, I think he use an unstable version of appium studio as it keeps losing connection, we mainly use it for finding xpath, then kill and restart.

As he is now in holiday, he will be able to share details in about 10 working days.