Skip to content

Commit

Permalink
log playwright action (#299)
Browse files Browse the repository at this point in the history
* log playwright action

* changeset
  • Loading branch information
sameelarif authored Dec 12, 2024
1 parent f11da27 commit fbe2300
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-planes-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@browserbasehq/stagehand": patch
---

log playwright actions for better debugging
17 changes: 17 additions & 0 deletions lib/handlers/actHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,23 @@ export class StagehandActHandler {
) {
const locator = this.stagehand.page.locator(`xpath=${xpath}`).first();
const initialUrl = this.stagehand.page.url();

this.stagehand.log({
category: "action",
message: "performing playwright method",
level: 2,
auxiliary: {
xpath: {
value: xpath,
type: "string",
},
method: {
value: method,
type: "string",
},
},
});

if (method === "scrollIntoView") {
this.stagehand.log({
category: "action",
Expand Down

0 comments on commit fbe2300

Please # to comment.