Navigate to URLs Find elements using various locator strategies Click, type, and interact with elements Perform mouse actions (hover, drag and drop) Handle keyboard input Take screenshots Upload files
暂无评论. 成为第一个评论的人!
登录以参与讨论
Launches a browser session. Parameters: browser (string) - `chrome`, `firefox`, `edge`, or `safari`; options (object, optional) - `{ headless: boolean, arguments: string[] }`.
Navigates to a URL. Parameters: url (string) - URL to navigate to.
Performs a mouse action on an element. Parameters: action (string) - `click`, `doubleclick`, `rightclick`, or `hover`; by (string) - Locator strategy: `id`, `css`, `xpath`, `name`, `tag`, `class`; value (string) - Value for the locator strategy; timeout (number, optional) - Max wait in ms (default: 10000).
Types text into an element. Clears the field first. Parameters: by (string) - Locator strategy; value (string) - Locator value; text (string) - Text to enter; timeout (number, optional) - Max wait in ms (default: 10000).
Gets the text content of an element. Parameters: by (string) - Locator strategy; value (string) - Locator value; timeout (number, optional) - Max wait in ms (default: 10000).
Gets an attribute value from an element. Parameters: by (string) - Locator strategy; value (string) - Locator value; attribute (string) - Attribute name (e.g., `href`, `value`, `class`); timeout (number, optional) - Max wait in ms (default: 10000).
Presses a keyboard key. Parameters: key (string) - Key to press (e.g., `Enter`, `Tab`, `a`).
Uploads a file via a file input element. Parameters: by (string) - Locator strategy; value (string) - Locator value; filePath (string) - Absolute path to the file; timeout (number, optional) - Max wait in ms (default: 10000).
Captures a screenshot of the current page. Parameters: outputPath (string, optional) - Save path. If omitted, returns base64 image data.
Closes the current browser session. No parameters.
Executes JavaScript in the browser. Use for advanced interactions not covered by other tools (e.g., drag and drop, scrolling, reading computed styles, DOM manipulation). Parameters: script (string) - JavaScript code to execute; args (array, optional) - Arguments accessible via `arguments[0]`, etc.
Manages browser windows and tabs. Parameters: action (string) - `list`, `switch`, `switch_latest`, or `close`; handle (string, optional) - Window handle (required for `switch`).
Switches focus to a frame or back to the main page. Parameters: action (string) - `switch` or `default`; by (string, optional) - Locator strategy (for `switch`); value (string, optional) - Locator value (for `switch`); index (number, optional) - Frame index, 0-based (for `switch`); timeout (number, optional) - Max wait in ms (default: 10000).
Handles browser alert, confirm, or prompt dialogs. Parameters: action (string) - `accept`, `dismiss`, `get_text`, or `send_text`; text (string, optional) - Text to send (required for `send_text`); timeout (number, optional) - Max wait in ms (default: 5000).
Adds a cookie. Browser must be on a page from the cookie's domain. Parameters: name (string) - Cookie name; value (string) - Cookie value; domain (string, optional) - Cookie domain; path (string, optional) - Cookie path; secure (boolean, optional) - Secure flag; httpOnly (boolean, optional) - HTTP-only flag; expiry (number, optional) - Unix timestamp.
Gets cookies. Returns all or a specific one by name. Parameters: name (string, optional) - Cookie name. Omit for all cookies.
Deletes cookies. Deletes all or a specific one by name. Parameters: name (string, optional) - Cookie name. Omit to delete all.
Gets browser diagnostics captured via WebDriver BiDi (auto-enabled when supported). Parameters: type (string) - `console`, `errors`, or `network`; clear (boolean, optional) - Clear buffer after returning (default: false).