Search code examples
xpathautomationwinappdriverappium-desktop

Invalid xPath expression when using appium and winappdriver


I'm trying to select an email in my automation code in outlook. I want to select the email by the name but the name contains the send date that I don't know. So I'm trying to find it out after Xpath.

Here is how I try to find it.

'//@[starts-with(normalize-space(text()), "From user-1, Subject testing sendmail,")]'

I get this error:

Original error: Invalid XPath expression: //@[starts-with(normalize-space(text()), "From reporter-user-1, Sub
ject testing sendmail,")]

Solution

  • //@ is invalid syntax. If you want to check name attribute you need to use either //@* or //@name