Chuyển đến nội dung
Skillpedia
Tự động hóa48k · #4066

browser-automation

Skill này làm gì

Công cụ này giúp kiểm thử và tự động hóa các thao tác trong trình duyệt web. Bạn có thể yêu cầu máy tính nhấp nút, điền biểu mẫu và kiểm tra xem các nội dung có hiện trên màn hình không, như thể người dùng đang sử dụng website.

Khi nào nên dùng

  • ✓Khi bạn muốn đảm bảo một website hoạt động đúng như mong đợi.
  • ✓Khi bạn muốn kiểm tra xem một tính năng mới trên website có hoạt động đúng không.
  • ✓Khi bạn cần xác minh thông tin trên một trang web là chính xác.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/browser-automation/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/browser-automation/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy nhấp vào nút 'Add to Cart' rồi kiểm tra xem số lượng trong giỏ hàng có bằng 1 không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng một chương trình (như Playwright hoặc Puppeteer) để điều khiển trình duyệt. Nó tìm các thành phần trên trang (như nút hoặc ô nhập liệu), thực hiện thao tác với chúng và kiểm tra kết quả.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Browser Automation

Use the browser tool already selected by the user or installed in the project. Playwright, Puppeteer and Selenium have different integrations; choose from actual requirements rather than unsupported success-rate claims. Modified by AAS maintainers on 2026-09-05: removed unverified comparisons and bypass defaults, clarified waiting and evidence limits.

Separate tests of applications you control from interaction with an existing authenticated browser. Do not replace the latter with a fresh unauthenticated session or extract credentials to make an automation test work.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

Playwright Test Example

""" import { test, expect } from '@playwright/test';

// Each test runs in isolated browser context test('user can add item to cart', async ({ page }) => { // Fresh context - no cookies, no storage from other tests await page.goto('/products'); await page.getByRole('button', { name: 'Add to Cart' }).click(); await expect(page.getByTestId('cart-count')).toHaveText('1'); });

test('user can remove item from cart', async ({ page }) => { // Completely isolated - cart is empty await page.goto('/cart'); await expect(page.getByText('Your cart is empty')).toBeVisible(); }); """

Good Examples (User-Facing)

""" // By role - THE BEST CHOICE await page.getByRole('button', { name: 'Submit' }).click(); await page.getByRole('link', { name: 'Sign up' }).click(); await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible(); await page.getByRole('textbox', { name: 'Search' }).fill('query');

// By text content await expect(page.getByText('Welcome back')).toBeVisible(); await page.getByText(/Order #\d+/).click(); // Regex supported

// By label (forms) await page.getByLabel('Email address').fill('user@example.com'); await page.getByLabel('Password').fill('secret');

// By placeholder await page.getByPlaceholder('Search...').fill('query');

// By test ID (when no user-facing option works) await page.getByTestId('submit-button').click(); """

Bad Examples (Fragile)

""" // DON'T - CSS selectors tied to structure await page.locator('.btn-primary.submit-form').click(); await page.locator('#header > div > button:nth-child(2)').click();

// DON'T - XPath tied to structure await page.locator('//div[@class="form"]/button[1]').click();

// DON'T - Auto-generated selectors await page.locator('[data-v-12345]').click(); """

When to Use

Use to verify a real browser workflow, diagnose a UI timing failure or collect explicitly authorized page data. Inspect the current page and available tool APIs before selecting locators or actions.

Worked example and prerequisites

Input: exporting a reviewed JSON file from a local web app. Have the app running, the intended browser available and a synthetic form value. Observe the export control, register the download event before clicking, inspect the downloaded JSON and confirm that editing the input invalidates the old preview. Expected: one file containing the reviewed value, with no hidden project data or network submission.

Use explicit desktop/mobile viewports and inspect keyboard/focus behavior when the task includes usability. A locked desktop leaves interactive verification pending; unit tests and headless probes are separate evidence.

Limitations

  • Auto-waiting checks actionability, not business correctness or successful backend writes.
  • Screenshots, HTML, traces and auth-state files may contain private information; capture only the authorized scope.
  • Retrying a read can be safe; retrying checkout, deletion or sending a message may duplicate a side effect. Verify state before repeating it.
  • Resource blocking and mocked responses change the environment and cannot establish unmodified production behavior.
  • Examples require the project’s imports, runner and fixture routes; no browser, service or account is installed by this skill.
Câu hỏi thường gặp

“Semantic locators” là gì?

Đây là cách thông minh để tìm nút bấm hoặc ô nhập liệu trên trang, như dựa vào chữ hiển thị trên đó (“Submit”) hoặc nhãn liên kết (“Email address”), thay vì dùng mã phức tạp.

Tại sao không nên dùng CSS selector hoặc XPath?

Vì chúng phụ thuộc nhiều vào cấu trúc chính xác của trang. Nếu trang thay đổi một chút, các selector này sẽ ngừng hoạt động và khiến bài kiểm thử dễ vỡ.

Công cụ có thể đăng nhập vào website thay tôi không?

Không nên dùng công cụ này để lấy thông tin xác thực hoặc thay thế phiên đăng nhập đã xác thực của trình duyệt. Nó phù hợp hơn để kiểm thử các luồng cụ thể trong một môi trường được kiểm soát.

Chi tiết

Mô tả gốc của tác giả

Build reliable browser checks using observed UI state, semantic locators, bounded waits, isolated test data and explicit outcome verification.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4066
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự