73 lines
1.6 KiB
Markdown
73 lines
1.6 KiB
Markdown
# agent-browser Commands
|
|
|
|
## Navigation And Snapshot
|
|
|
|
```bash
|
|
agent-browser open <url>
|
|
agent-browser close
|
|
agent-browser snapshot -i
|
|
agent-browser snapshot -i -C
|
|
agent-browser snapshot -s "#selector"
|
|
```
|
|
|
|
## Interaction
|
|
|
|
```bash
|
|
agent-browser click @e1
|
|
agent-browser click @e1 --new-tab
|
|
agent-browser fill @e2 "text"
|
|
agent-browser type @e2 "text"
|
|
agent-browser select @e1 "option"
|
|
agent-browser check @e1
|
|
agent-browser press Enter
|
|
agent-browser keyboard type "text"
|
|
agent-browser keyboard inserttext "text"
|
|
agent-browser scroll down 500
|
|
agent-browser scroll down 500 --selector "div.content"
|
|
```
|
|
|
|
## Information And Waits
|
|
|
|
```bash
|
|
agent-browser get text @e1
|
|
agent-browser get url
|
|
agent-browser get title
|
|
agent-browser wait @e1
|
|
agent-browser wait --load networkidle
|
|
agent-browser wait --url "**/page"
|
|
agent-browser wait 2000
|
|
```
|
|
|
|
## Capture And Diff
|
|
|
|
```bash
|
|
agent-browser screenshot
|
|
agent-browser screenshot --full
|
|
agent-browser screenshot --annotate
|
|
agent-browser pdf output.pdf
|
|
agent-browser diff snapshot
|
|
agent-browser diff snapshot --baseline before.txt
|
|
agent-browser diff screenshot --baseline before.png
|
|
agent-browser diff url <url1> <url2> --wait-until networkidle
|
|
```
|
|
|
|
## Downloads
|
|
|
|
```bash
|
|
agent-browser download @e1 ./file.pdf
|
|
agent-browser wait --download ./output.zip
|
|
agent-browser --download-path ./downloads open <url>
|
|
```
|
|
|
|
## Semantic Locators
|
|
|
|
Use when refs are unavailable or unreliable:
|
|
|
|
```bash
|
|
agent-browser find text "Sign In" click
|
|
agent-browser find label "Email" fill "user@test.com"
|
|
agent-browser find role button click --name "Submit"
|
|
agent-browser find placeholder "Search" type "query"
|
|
agent-browser find testid "submit-btn" click
|
|
```
|