What Is SelectorsHub? And How To Use SelectorsHub?

Mrunali Sawarkar
2 min readDec 25, 2023

--

Today, we’ll dive into the world of SelectorsHub, a powerful browser plugin designed to make your life easier when dealing with XPath, CSS selectors, and more.

SelectorsHub is a browser extension designed to simplify the process of writing and generating XPath selectors for various elements. It goes beyond the conventional and supports complex scenarios like iframes, nested iframes, shadow DOM, dynamic elements, and much more. It’s a comprehensive solution that provides accurate selector counts and supports elements that were previously challenging to select.

Installation and Compatibility
Getting started with SelectorsHub is a breeze. Visit https://selectorshub.com/ to grab the extension or head directly to the Chrome Web Store. The plugin is compatible with a range of browsers, including Chrome, Firefox, Edge, Opera, Brave, Safari, and Chromium.

Here’s a quick installation guide:

Click on “Add to Chrome” in the Chrome Web Store.
Once installed, find the SelectorsHub icon — you may need to click the puzzle icon and pin it for easy access.

Key Features and Benefits
1. Verification of Selectors
SelectorsHub provides a seamless way to verify selectors before incorporating them into your automation scripts. Instead of relying on console checks, simply input your XPath or selector, and SelectorsHub will confirm its validity, ensuring you start on the right foot.

2. Auto-Suggestions for Selectors
For beginners and seasoned automation testers alike, SelectorsHub offers a helpful auto-suggestion feature. When constructing a selector, it presents a list of potential attributes, such as name, placeholder, and class, providing alternatives and simplifying the selector creation process.

3. Auto-Suggestion Count
SelectorsHub takes it a step further by indicating the number of matching elements for each suggestion. This not only aids in selector creation but also helps ensure uniqueness and accuracy in your locators.

4. Debugging with Timer
Encountering scenarios where elements disappear before you can inspect them? SelectorsHub has you covered. The “Click to customize your UI” feature allows you to set a debugger timer, giving you a few seconds to inspect elements without them vanishing.

5. Handling Frames and Shadow DOM
SelectorsHub provides valuable insights into whether an element resides within a frame or Shadow DOM. It even generates code snippets to assist you in seamlessly switching to frames or handling Shadow DOM elements.

6. CSS Selector Support
While XPath is a commonly used selector strategy, SelectorsHub supports CSS selectors as well. The auto-suggestion feature extends to CSS, offering multiple options and reducing confusion around CSS syntax.

Its features empower testers to create robust and efficient locators, handle complex scenarios like frames and Shadow DOM, and navigate potential pitfalls with advanced warnings. As you embark on your automation journey, give SelectorsHub a try, and witness the positive impact it can have on your testing efforts.

--

--