Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.7k 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 (62.9k 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.


Browse Categories