which locator is best/Trustable Xpath CSS JQuery ?

25 views
Skip to first unread message

javel...@gmail.com

unread,
May 4, 2018, 2:53:54 AM5/4/18
to Selenium Users
Hello Selenium user, 

Can anyone please share which of the following three locator is best and why? 

1. xpath 2. CSS 3. JQuery 

Thanks!! 

Jonathan Herbaut

unread,
May 4, 2018, 3:14:00 AM5/4/18
to seleniu...@googlegroups.com
Hi ! :)
For my personal use, I prefer Id and Name, then CSS class. I prefer to never use XPath because if you don't aim accuratly your element, you can target another one if your UI is evolving.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0a7cd9f1-98af-4677-8150-1714929dd378%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ankit Gupta

unread,
May 4, 2018, 3:16:51 AM5/4/18
to seleniu...@googlegroups.com
I prefer xpath, because using xpath you can find any element. it has many functionality like (sibling, parent, ancestor, and number of options are there not in anything else)

On Fri, May 4, 2018 at 12:43 PM, Jonathan Herbaut <jonathan...@gmail.com> wrote:
Hi ! :)
For my personal use, I prefer Id and Name, then CSS class. I prefer to never use XPath because if you don't aim accuratly your element, you can target another one if your UI is evolving.
2018-05-04 8:53 GMT+02:00 <javel...@gmail.com>:
Hello Selenium user, 

Can anyone please share which of the following three locator is best and why? 

1. xpath 2. CSS 3. JQuery 

Thanks!! 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages