Using 'ends-with' XPath 2.0 Expression in Chrome with Selenium

188 views
Skip to first unread message

Nicolas Benavides

unread,
Oct 12, 2023, 10:58:41 PM10/12/23
to Selenium Users
Hey there,

I need to use a specific `ends-with` Xpath 2.0 expression, but I have found Chrome only supports Xpath 1.0, Is there any way to force it, I mean a plugin, Selenium option, or whatever possibility?

Appreciate any help!

Adrian

unread,
Oct 15, 2023, 3:46:32 PM10/15/23
to Selenium Users
Hi,
Yes you can do it the long way.
Given you go to Google.com
When you open the dev tools 
And search for the following: //*[substring(@id, string-length(@id) - string-length('Fqb') + 1)  = 'Fqb']
Then the search text area will be located

The actual id of the search textarea is "APjFqb"


Cheers,
Adrian.
Reply all
Reply to author
Forward
0 new messages