Loading...
Loading...
Compare original and translation side by side
playwright-cli-s=playwright-cli-s=--headedopen-s=<name>PLAYWRIGHT_MCP_CAPS=visionopen--headed-s=<name>PLAYWRIGHT_MCP_CAPS=visionundefinedundefined
Managing sessions:
```bash
playwright-cli list # list all sessions
playwright-cli close-all # close all sessions
playwright-cli -s=<name> close # close specific session
playwright-cli -s=<name> delete-data # wipe session profile
会话管理命令:
```bash
playwright-cli list # 列出所有会话
playwright-cli close-all # 关闭所有会话
playwright-cli -s=<name> close # 关闭指定会话
playwright-cli -s=<name> delete-data # 清空会话配置文件Core: open [url], goto <url>, click <ref>, fill <ref> <text>, type <text>, snapshot, screenshot [ref], close
Navigate: go-back, go-forward, reload
Keyboard: press <key>, keydown <key>, keyup <key>
Mouse: mousemove <x> <y>, mousedown, mouseup, mousewheel <dx> <dy>
Tabs: tab-list, tab-new [url], tab-close [index], tab-select <index>
Save: screenshot [ref], pdf, screenshot --filename=f
Storage: state-save, state-load, cookie-*, localstorage-*, sessionstorage-*
Network: route <pattern>, route-list, unroute, network
DevTools: console, run-code <code>, tracing-start/stop, video-start/stop
Sessions: -s=<name> <cmd>, list, close-all, kill-all
Config: open --headed, open --browser=chrome, resize <w> <h>核心命令: open [url], goto <url>, click <ref>, fill <ref> <text>, type <text>, snapshot, screenshot [ref], close
导航命令: go-back, go-forward, reload
键盘操作: press <key>, keydown <key>, keyup <key>
鼠标操作: mousemove <x> <y>, mousedown, mouseup, mousewheel <dx> <dy>
标签页管理: tab-list, tab-new [url], tab-close [index], tab-select <index>
保存操作: screenshot [ref], pdf, screenshot --filename=f
存储管理: state-save, state-load, cookie-*, localstorage-*, sessionstorage-*
网络操作: route <pattern>, route-list, unroute, network
开发者工具: console, run-code <code>, tracing-start/stop, video-start/stop
会话操作: -s=<name> <cmd>, list, close-all, kill-all
配置选项: open --headed, open --browser=chrome, resize <w> <h>--persistentPLAYWRIGHT_MCP_VIEWPORT_SIZE=1440x900 playwright-cli -s=<session-name> open <url> --persistent--persistentPLAYWRIGHT_MCP_VIEWPORT_SIZE=1440x900 playwright-cli -s=<session-name> open <url> --persistent
3. Get element references via snapshot:
```bash
playwright-cli snapshotplaywright-cli click <ref>
playwright-cli fill <ref> "text"
playwright-cli type "text"
playwright-cli press Enterplaywright-cli screenshot
playwright-cli screenshot --filename=output.pngplaywright-cli -s=<session-name> close
3. 通过snapshot命令获取元素引用:
```bash
playwright-cli snapshotplaywright-cli click <ref>
playwright-cli fill <ref> "text"
playwright-cli type "text"
playwright-cli press Enterplaywright-cli screenshot
playwright-cli screenshot --filename=output.pngplaywright-cli -s=<session-name> closeplaywright-cli.json--config path/to/config.json{
"browser": {
"browserName": "chromium",
"launchOptions": { "headless": true },
"contextOptions": { "viewport": { "width": 1440, "height": 900 } }
},
"outputDir": "./screenshots"
}playwright-cli.json--config path/to/config.json{
"browser": {
"browserName": "chromium",
"launchOptions": { "headless": true },
"contextOptions": { "viewport": { "width": 1440, "height": 900 } }
},
"outputDir": "./screenshots"
}playwright-cli --helpplaywright-cli --help <command>playwright-cli --helpplaywright-cli --help <command>