0 votes
1 view
in Devops and Agile by (16.4k points)

I was wondering if there is such an addon in firefox where you can test out CSS paths to check if they are finding the correct element? I was looking for something similar to XPath for XPath locations.

1 Answer

0 votes
by (45.5k points)

Here's how to use the built-in CSS query selector in Firefox:

Go to Tools > Web Developer > Web Console

Also, you could press ctrl shift i in Windows/Linux, or cmd opt i in Mac.

Type in your CSS selector (using traditional  $$() syntax) at the very bottom left corner.

The object node list will appear on the right-hand panel of the console.

$$('div') [object NodeList] $$('div').length 42

This is handy for Selenium Webdriver instances of Firefox, were having an extension isn't feasible.

 

...