Skip to main content

截图

🌐 Screenshots

browser_take_screenshot

捕捉当前页面、特定元素或整个可滚动页面。

🌐 Capture the current page, a specific element, or the full scrollable page.

参数类型是否必填描述
type字符串png(默认)或 jpeg
ref字符串截取特定元素的引用
fullPage布尔值捕获完整可滚动页面

页面截图

🌐 Page screenshot

You: Take a screenshot of the current page.
→ browser_take_screenshot
→ Returns: PNG image of the viewport

元素截图

🌐 Element screenshot

You: Take a screenshot of just the login form.
→ browser_take_screenshot { ref: "e12" }
→ Returns: PNG image cropped to the element

整页截图

🌐 Full-page screenshot

You: Take a full-page screenshot including content below the fold.
→ browser_take_screenshot { fullPage: true }
→ Returns: PNG image of entire scrollable page

何时使用截图

🌐 When to use screenshots

截图补充了辅助功能快照:

🌐 Screenshots complement accessibility snapshots:

用例最佳工具
与元素交互辅助功能快照(引用)
验证视觉布局截图
画布/图表内容截图
记录错误截图
了解页面结构辅助功能快照
阅读文本内容辅助功能快照