Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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.

 

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.5k answers

500 comments

108k users

Browse Categories

...