browserstage

v0.1.0
io.github.CloudCorpRecords/browserstage Checked 3 days ago Published 1 month ago

Automate a browser with accessibility snapshots: navigate, click, type, fill and wait.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

browser_navigate

Navigate to a URL

ParameterTypeDescription
url *stringThe URL to navigate the page to

browser_navigate_back

Go back to the previous page in the browser history

browser_snapshot

Capture accessibility snapshot of the current page

ParameterTypeDescription
depthnumberOptional maximum depth of the accessibility tree to capture
filenamestringOptional filename to save the snapshot to
targetstringOptional element reference from a page snapshot to scope the snapshot to

browser_find

Search the accessibility snapshot for text or a regular expression

ParameterTypeDescription
regexstringOptional regular expression to search for in the page snapshot
textstringOptional text to search for in the page snapshot

browser_click

Perform click on a web page

ParameterTypeDescription
element *stringHuman-readable description of the element to click
target *stringElement reference from a page snapshot to click
buttonstringOptional mouse button to click with: left, right, or middle
doubleClickbooleanWhether to double click the element

browser_hover

Hover over an element on the page

ParameterTypeDescription
element *stringHuman-readable description of the element to hover over
target *stringElement reference from a page snapshot to hover over

browser_drag

Perform drag and drop between two elements

ParameterTypeDescription
endElement *stringHuman-readable description of the element to drop onto
endTarget *stringElement reference of the element to drop onto
startElement *stringHuman-readable description of the element to drag from
startTarget *stringElement reference of the element to drag from

browser_drop

Drop files or data onto an element on the page

ParameterTypeDescription
element *stringHuman-readable description of the element to drop onto
target *stringElement reference of the element to drop onto
pathsarrayOptional file paths to drop onto the element

browser_select_option

Select an option in a dropdown

ParameterTypeDescription
target *stringElement reference of the dropdown to select an option in
values *arrayThe option values to select in the dropdown

browser_type

Type text into an editable element

ParameterTypeDescription
element *stringHuman-readable description of the editable element to type into
target *stringElement reference of the element to type into
text *stringThe text to type into the element
slowlybooleanWhether to type the text one character at a time
submitbooleanWhether to press Enter after typing

browser_press_key

Press a key on the keyboard

ParameterTypeDescription
key *stringThe key to press, such as Enter, ArrowDown, or a single character

browser_fill_form

Fill multiple form fields

ParameterTypeDescription
fields *arrayThe form fields to fill; each field carries a name, a type, a value, and an optional element target

browser_take_screenshot

Take a screenshot of the current page

ParameterTypeDescription
filenamestringOptional filename to save the screenshot to
fullPagebooleanWhether to capture the full scrollable page instead of the viewport
targetstringOptional element reference from a page snapshot to screenshot instead of the page
typestringOptional image format of the screenshot, such as png or jpeg

browser_run_code_unsafe

Run a Playwright code snippet against the current page (unsafe: arbitrary code execution)

ParameterTypeDescription
code *stringThe Playwright code snippet to run against the current page

browser_evaluate

Evaluate JavaScript expression on the page or on an element

ParameterTypeDescription
function *stringThe JavaScript function to evaluate on the page or on an element
elementstringOptional human-readable description of the element to evaluate on
targetstringOptional element reference to evaluate the function on

browser_wait_for

Wait for text to appear or disappear, or for a specified time to pass

ParameterTypeDescription
textstringOptional text to wait for the page to contain
textGonestringOptional text to wait for the page to no longer contain
timenumberOptional time in seconds to wait

browser_handle_dialog

Handle a browser dialog

ParameterTypeDescription
accept *booleanWhether to accept the dialog (true) or dismiss it (false)
promptTextstringOptional text to enter into a prompt dialog

browser_file_upload

Upload one or multiple files

ParameterTypeDescription
pathsarrayOptional file paths to upload; when omitted, an open file chooser is cancelled

browser_console_messages

Returns all console messages

ParameterTypeDescription
allbooleanWhether to return console messages for all frames, not just the current page
filenamestringOptional filename to save the console messages to
levelstringOptional console message level to return: info, warning, error, or debug

browser_network_requests

Returns a numbered list of network requests since loading the page

ParameterTypeDescription
filenamestringOptional filename to save the request list to
staticbooleanOptional flag to filter the list by static resource requests

browser_network_request

Returns the full details of a single network request

ParameterTypeDescription
index *numberThe index of the network request in the browser_network_requests list
filenamestringOptional filename to save the request details to

browser_tabs

List, create, close, or select a browser tab

ParameterTypeDescription
action *stringThe tab action to perform: list, new, close, or select
indexnumberOptional index of the tab for the close and select actions
urlstringOptional URL to open when the action is new

browser_close

Close the current page and the browser

browser_resize

Resize the browser window

ParameterTypeDescription
height *numberThe new browser window height in pixels
width *numberThe new browser window width in pixels