Skip to main content

表格

🌐 Forms

browser_type

在可编辑元素(输入框、文本区域、可编辑内容)中输入文本。

🌐 Type text into an editable element (input, textarea, contenteditable).

参数类型是否必填描述
ref字符串元素引用
text字符串要输入的文本
submit布尔值输入后按回车
slowly布尔值一次输入一个字符(触发按键处理器)
→ browser_type { ref: "e5", text: "Buy groceries" }
→ browser_type { ref: "e5", text: "Buy groceries", submit: true } // types + Enter
→ browser_type { ref: "e8", text: "search query", slowly: true } // triggers autocomplete

browser_fill_form

一次填写多个表单字段。支持文本框、复选框、单选按钮、组合框和滑块。

🌐 Fill multiple form fields at once. Supports textboxes, checkboxes, radio buttons, comboboxes, and sliders.

→ browser_snapshot
- textbox "First name" [ref=e3]
- textbox "Last name" [ref=e5]
- textbox "Email" [ref=e7]
- checkbox "Accept terms" [ref=e9]
- combobox "Country" [ref=e11]
- radio "Monthly plan" [ref=e13]
- radio "Annual plan" [ref=e15]

→ browser_fill_form {
fields: [
{ ref: "e3", value: "Alice" },
{ ref: "e5", value: "Smith" },
{ ref: "e7", value: "alice@example.com" },
{ ref: "e9", value: true },
{ ref: "e11", value: "United States" },
{ ref: "e15", value: true }
]
}

这比为每个字段单独调用 browser_typebrowser_click 更高效。

🌐 This is more efficient than calling browser_type and browser_click for each field individually.

浏览器_检查 / 浏览器_取消检查

🌐 browser_check / browser_uncheck

勾选或取消勾选复选框或单选按钮。

🌐 Check or uncheck a checkbox or radio button.

参数类型必填描述
ref字符串元素引用
→ browser_check { ref: "e9" }     // check the "Accept terms" checkbox
→ browser_uncheck { ref: "e9" } // uncheck it

工作流程:完成多步骤表单

🌐 Workflow: completing a multi-step form

You: Fill out the registration form on this page.

→ browser_snapshot
// Page 1: Personal info
- textbox "Email" [ref=e3]
- textbox "Password" [ref=e5]
- button "Next" [ref=e7]

→ browser_type { ref: "e3", text: "alice@example.com" }
→ browser_type { ref: "e5", text: "s3cureP@ss!" }
→ browser_click { ref: "e7" }

→ browser_snapshot
// Page 2: Profile
- textbox "Display name" [ref=e3]
- combobox "Timezone" [ref=e5]
- checkbox "Subscribe to newsletter" [ref=e7]
- button "Create account" [ref=e9]

→ browser_fill_form {
fields: [
{ ref: "e3", value: "Alice S." },
{ ref: "e5", value: "US/Pacific" },
{ ref: "e7", value: true }
]
}
→ browser_click { ref: "e9" }