css and xpath selectors

  • 2 Replies
css and xpath selectors
« on: May 02, 2016, 17:10:46 pm »
why css selector is much faster than xpath ?



  • **
  • 59
Re: css and xpath selectors
« Reply #1 on: May 02, 2016, 19:42:05 pm »
Xpath engines are different in each browser, hence make them inconsistent.

The main reason is that tests which intensively use XPath work extremely slow under IE and this feature is the cause of huge variety of problems related to execution speed as well as quality of the tests itself especially during operations with dynamic content.

Naturally, CSS locators have some limitations such as: problems to locate objects by index, problem to locate objects higher in the object hierarchy or so. Either way, if you are interested in your tests performance you'd better try to use CSS locators prior to XPath. XPath is needed in case all other locators aren't capable.

Re: css and xpath selectors
« Reply #2 on: May 03, 2016, 05:12:51 am »
if xpath engines are different in each browser,then will the same xpath expression works in different ways?  And also why the quality of test cases change with xpath
« Last Edit: May 03, 2016, 05:14:34 am by siri »


Sitemap 1 2 3 4 5 6 7 8