Feature Guide

Locator Generator
Capabilities & Limitations

Complete guide on what scenarios the tool handles and where it needs manual intervention.

πŸš€ Try It Out

Start using the Locator Generator Tool to generate selectors from your HTML.

πŸ§ͺ Hands-On Testing

Follow the Test Cases Guide to test LIMITED scenarios with provided HTML examples.

βœ… Fully Supported Scenarios

SUPPORTED Basic HTML Elements
  • Input fields (text, email, password)
  • Buttons (regular & submit)
  • Links (a href)
  • Divs, spans, paragraphs
  • Tables, forms, lists
SUPPORTED Attribute-Based Selection
  • ID attributes
  • Class attributes
  • Name attributes
  • Type attributes
  • Data attributes
  • Custom attributes
SUPPORTED Locator Types Generated
  • ID Selector (#id)
  • CSS Class (.class)
  • CSS Selectors (full path)
  • XPath (absolute)
  • XPath (relative)
  • Attribute selectors
SUPPORTED Special Characters
  • Unicode characters (δΈ­ζ–‡, Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©)
  • Emojis (πŸ˜€, πŸ”₯, ✨)
  • Special symbols (Β©, €, β„’)
  • Quotes in attributes
  • Escaped characters
SUPPORTED Advanced Features
  • iframe detection & handling
  • Deep nesting detection
  • Duplicate ID/Name warnings
  • Performance optimization
  • Large file handling (1MB+)
SUPPORTED Error Handling
  • Invalid HTML detection
  • Unclosed tag warnings
  • Script/Style tag alerts
  • Parse error messages
  • User-friendly error display

⚠️ Limited/Partial Support

The following scenarios are partially supported by the tool. They work for basic use cases but may have limitations. Check the πŸ§ͺ Test Cases page to learn how to test these scenarios.

LIMITED SVG Elements
Status: βœ… Generates basic XPath/CSS selectors

Issue: SVG has special namespaces that may require manual adjustment

Workaround: Use CSS selectors or relative XPath
//svg//rect[@fill='red']
Test it: SVG Elements Test
LIMITED Hidden Elements
Status: βœ… Generates selectors for hidden elements

Issue: May not be interactable in automation

Note: Tool detects hidden attribute and display:none
Test it: Hidden Elements Test
LIMITED Dynamic IDs/Classes
Status: βœ… Generates selectors but they may not be stable

Example: react-12345, ember-id-123, ng-app-456

Recommendation: Use relative XPath or data attributes instead
Test it: Dynamic IDs/Classes Test
LIMITED Nested iframes
Status: βœ… Detects iframes and generates code

Limitation: Nested iframe auto-switching code must be adjusted manually

Workaround: Manually nest the frame switching commands
driver.switchTo().frame(iframe1) driver.switchTo().frame(iframe2) element = driver.find_element(...)
Test it: Nested iframes Test
LIMITED Web Components
Status: Can generate selectors for outer shell

Issue: Can't access Shadow DOM elements

Limitation: Browser sandbox prevents access to shadow DOM
LIMITED Complex Tables
Status: Generates selectors for table elements

Issue: No intelligent row/cell indexing

Recommendation: Use data-* attributes for table cells

❌ Not Supported / Manual Work Required

NOT SUPPORTED Shadow DOM
Elements inside Shadow DOM are hidden from the DOM parser due to browser security.

Solution: Use browser's DevTools to inspect, then manually create selectors or use JavaScript injection
NOT SUPPORTED JavaScript-Generated Content
Elements created dynamically by JavaScript/React/Vue aren't visible in static HTML.

Solution: Inspect in browser DevTools after page loads
NOT SUPPORTED Pseudo-Elements
CSS pseudo-elements (::before, ::after) can't be selected directly.

Solution: Select parent element, or use JavaScript to access content
NOT SUPPORTED Hover/Focus States
Interactive states (hover, focus, active) aren't visible in static HTML.

Solution: Inspect element while in that state, or use action-based selection
NOT SUPPORTED Browser-Only Features
Things that only exist in browser runtime:
  • Computed styles
  • Event listeners
  • JavaScript variables
  • Scroll position
  • Viewport visibility
NOT SUPPORTED Cross-Origin Content
Can't access content from different domains due to CORS.

Solution: Copy/paste HTML from target domain manually

πŸ“Š Quick Reference Table

Scenario Support Level Notes
Regular HTML elements SUPPORTED Full support for all common elements
ID/Class selectors SUPPORTED Handles special characters correctly
XPath expressions SUPPORTED Both absolute and relative XPath
Unicode/Emojis SUPPORTED Full UTF-8 character support
iframes SUPPORTED Detects and shows code examples
SVG elements LIMITED Generates selectors, handles namespaces | Test
Hidden elements LIMITED Detects and generates code, may not be interactive | Test
Dynamic IDs/Classes LIMITED Generates selectors but may be unstable | Test
Nested iframes LIMITED Detects and generates code, may need manual adjustment | Test
Shadow DOM NOT SUPPORTED Browser security prevents access
JavaScript-rendered content NOT SUPPORTED Only static HTML is analyzed
Pseudo-elements (::before, ::after) NOT SUPPORTED Not accessible via DOM selectors
Hover/Focus states NOT SUPPORTED Not visible in static HTML
Cross-origin content NOT SUPPORTED CORS restrictions apply

πŸ’‘ Best Practices & Recommendations

✨ Tips for Better Locators
  1. Use stable attributes first: ID > Name > XPath > CSS Class
  2. Avoid dynamic IDs: If ID changes between page loads, use other attributes
  3. Data attributes are your friend: Use data-testid or similar for testing
  4. Relative XPath for flexibility: Better than absolute paths when structure changes
  5. Combine multiple attributes: Instead of relying on one attribute
  6. Test in real browser: Always verify selector works in actual browser automation
  7. Handle dynamic content: Use waits and explicit conditions for JS-rendered content
  8. Document your approach: Keep notes on why you chose each selector

πŸ› οΈ When to Use Manual Approaches

Use Tool For:
  • Standard HTML elements
  • Initial locator exploration
  • Learning XPath/CSS syntax
  • Quick prototype locators
  • Understanding element structure
  • Generating starter code
Use Manual For:
  • Shadow DOM elements
  • Dynamic JavaScript content
  • Pseudo-elements
  • Complex interactive states
  • Cross-browser compatibility
  • Production-grade selectors