How to verify an XPath expression in Chrome Developers tool or Firefox's Firebug? -


how can verify xpath?

i using chrome developers tool inspect elements , form xpath. verify using chrome plugin xpath checker, not give me result. better way verify xpath.

i have tried using firebug inspect bug , using firepath verify. firepath verify xpath.

my last option use selenium webdriver confirm xpath.

chrome

this can achieved 3 different approaches (see blog article here more details):

  • search in elements panel below
  • execute $x() , $$() in console panel, shown in lawrence's answer
  • third party extensions (not necessary in of cases, overkill)

here how search xpath in elements panel:

  1. press f12 open chrome developer tool
  2. in "elements" panel, press ctrl+f
  3. in search box, type in xpath or css selector, if elements found, highlighted in yellow.

enter image description here

firefox

  1. install firebug
  2. install firepath
  3. press f12 open firebug
  4. switch firepath panel
  5. in dropdown, select xpathor css
  6. type in locate

enter image description here


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -