This commit is contained in:
Josh at WLTechBlog
2025-08-19 06:15:55 -05:00
parent 58e361ba70
commit 36adab7878
9 changed files with 506 additions and 46 deletions

View File

@@ -196,7 +196,7 @@ func main() {
"action": map[string]any{
"type": "string",
"description": "Action to perform",
"enum": []any{"click", "fill", "submit", "upload"},
"enum": []any{"click", "fill", "submit", "upload", "select"},
},
"selector": map[string]any{
"type": "string",
@@ -267,6 +267,13 @@ func main() {
err = cremoteServer.client.UploadFile(tab, selector, value, timeout, timeout)
message = fmt.Sprintf("Uploaded file %s to element %s", value, selector)
case "select":
if value == "" {
return nil, fmt.Errorf("value parameter is required for select action")
}
err = cremoteServer.client.SelectElement(tab, selector, value, timeout, timeout)
message = fmt.Sprintf("Selected option %s in element %s", value, selector)
default:
return nil, fmt.Errorf("unknown action: %s", action)
}