Invalid selector: Unable to locate an element with the XPath expression:
//span[@class='title-subGrid-lite-TextAutoEllipsis’][text()[contains(.,'My Emails')]
Correct me.
This error message...
org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //span[@class='title-subGrid-lite-TextAutoEllipsis’][text()[contains(.,'My Emails')]
...implies that the XPath which you have used was not a valid one.
The xpath expression you have used as follows have a couple of issues:
//span[@class='title-subGrid-lite-TextAutoEllipsis’][text()[contains(.,'My Emails')]
'...'.[...]The simple XPath expression which must have catered to your requirement is:
//span[@class='title-subGrid-lite-TextAutoEllipsis'][contains(.,'My Emails')]
As an alternative you can also try:
//span[@class='title-subGrid-lite-TextAutoEllipsis' and contains(.,'My Emails')]
Perhaps you must be looking for:
//span[@class='title-subGrid-lite-TextAutoEllipsis'][normalize-space()='My Emails']
//span[@class='title-subGrid-lite-TextAutoEllipsis' and contains(.,'My Emails')]are tou looking for this?