Merk
Tilgang til denne siden krever autorisasjon. Du kan prøve å logge på eller endre kataloger.
Tilgang til denne siden krever autorisasjon. Du kan prøve å endre kataloger.
Modern AI coding assistants can dramatically accelerate Playwright test authoring. Instead of manually inspecting the DOM to find selectors, you can describe what you want to test in natural language and let AI generate the test code. This section explains how to integrate generative AI tools into your Power Platform testing workflow.
Available AI integrations
The following table summarizes the AI integrations available for Power Platform Playwright testing and when to use each one.
| Tool | What it does | Best for |
|---|---|---|
| Playwright MCP server | Gives AI assistants live access to your running browser | Generating selectors, writing tests with live inspection |
| AI test authoring with Copilot | Uses Playwright codegen and AI chat to scaffold tests | First-time test creation, unfamiliar apps |
| Custom instructions for AI agents | Teaches your AI assistant your project conventions | Consistent code style, toolkit API usage |
How generative AI accelerates Power Platform testing
Writing tests for Power Platform apps requires knowing:
- The correct iframe to scope locators to (
iframe[name="fullscreen-app-host"]) - The
data-control-nameattribute values for controls in your specific app - Which toolkit class and method to call (
GridComponent,FormComponent, etc.) - The right timeouts for Dataverse-backed galleries (30–60 seconds)
AI tools reduce the knowledge needed by:
- Inspecting the live DOM: The Playwright MCP server lets AI assistants see exactly what's on screen, find attributes, and generate accurate selectors without you having to open DevTools.
- Recording interactions: Playwright codegen records your clicks and form fills as test code, which AI can then clean up and annotate.
- Applying conventions: Custom instruction files teach AI assistants your project's patterns, so generated tests use the right toolkit APIs instead of raw Playwright.
Recommended workflow
The most productive workflow combines all three tools:
- Start the app in play mode in a browser.
- Run Playwright MCP server (connects AI assistant to that browser).
- Ask AI: "Write a test that opens the Orders gallery and verifies the first row."
- AI inspects DOM, finds selectors, and generates test using your toolkit conventions.
- Review and commit the generated test.
For complex scenarios
- Use Playwright codegen to record the happy path.
- Paste the recording into your AI chat.
- Ask AI to rewrite it using AppProvider and ModelDrivenAppPage.
- AI applies your custom instructions and produces toolkit-idiomatic test.
Supported AI assistants
The Playwright MCP server and custom instructions work with any MCP-compatible AI assistant:
- GitHub Copilot (VS Code, Visual Studio)
- Claude (Anthropic, Claude Code)
- Cursor
- Windsurf
- Any assistant with MCP client support.
Next steps
- Set up the Playwright MCP server
- Author tests with AI and Copilot
- Write custom instructions for your AI agent