wsbaser:xcss-selectors

Construct XCSS selectors from HTML markup and CSS/XPath for UnionInit attributes.

1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/wsbaser/claude-plugins --skill wsbaser-xcss-selectors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wsbaser:xcss-selectors
Source: https://github.com/wsbaser/claude-plugins/tree/main/plugins/wsbaser/skills/xcss-selectors
Command: npx skills add https://github.com/wsbaser/claude-plugins --skill wsbaser-xcss-selectors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers and QA engineers generate XCSS selectors for web page elements to be used with UnionInit in the Union.Playwright.NUnit framework, enabling robust element targeting by converting XPath or CSS selectors to XCSS syntax and providing guidance for optimal UI element identification.

Core Features & Use Cases

  • Generate XCSS selectors from HTML markup and existing selectors for reliable UI targeting.
  • Convert CSS selectors and XPath expressions to XCSS compatible forms for UnionInit attributes.
  • Provide examples and best practices for resilient selectors across dynamic pages and test suites.

Quick Start

Provide an XCSS selector for a target element described by HTML markup.

Frequently Asked Questions about wsbaser:xcss-selectors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate XPath selectors from CSS syntax for Playwright UI automation?

You can generate XPath selectors from CSS syntax by using XCSS, a CSS-like syntax that compiles to XPath for robust UI element targeting in Playwright automation. It produces unique, safe selectors for testing.

What is the best way to convert HTML markup to robust selectors for UI testing?

The best way to convert HTML markup to robust UI testing selectors is to apply XCSS syntax, which supports direct text matches, class and id shortcuts, and sub-element predicates to deliver readable, unique selectors.

Can I use XCSS selectors with the Union.Playwright.NUnit framework?

Yes, XCSS selectors are specifically designed for use with UnionInit attributes in the Union.Playwright.NUnit framework, enabling reliable element targeting by converting XPath or CSS selectors to XCSS syntax.

How do I handle dynamic class and id attributes when constructing XPath queries?

To handle dynamic class and id attributes, construct XCSS selectors using attribute contains queries and sub-element predicates. This CSS-like approach compiles to XPath, ensuring resilient element targeting across dynamic pages.

Does XCSS support direct text matching for web page elements?

Yes, XCSS supports direct text matches for web page elements. It applies a CSS-like syntax that compiles to XPath, allowing you to target elements safely and generate optimal selectors for your test suites.

When should I convert existing CSS selectors to XCSS syntax instead of using raw XPath?

You should convert existing CSS selectors to XCSS syntax when you need safe, readable selectors for UnionInit attributes, as XCSS provides a simpler CSS-like syntax that compiles to robust XPath expressions for UI testing.