Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sceptical-mutant-shrew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stagehand": patch
---

Fix error in press_key act util function
4 changes: 2 additions & 2 deletions stagehand/handlers/act_handler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ async def fill_or_type(ctx: MethodHandlerContext) -> None:
async def press_key(ctx: MethodHandlerContext) -> None:
try:
key = str(ctx.args[0]) if ctx.args and ctx.args[0] is not None else ""
await ctx.locator._page.keyboard.press(key)
await ctx.stagehand_page._page.keyboard.press(key)
await handle_possible_page_navigation(
"press",
ctx.xpath,
Expand Down Expand Up @@ -398,7 +398,7 @@ async def fallback_locator_method(ctx: MethodHandlerContext) -> None:
ctx.logger.debug(
message="page URL before action",
category="action",
auxiliary={"url": {"value": ctx.locator._page.url, "type": "string"}},
auxiliary={"url": {"value": ctx.stagehand_page._page.url, "type": "string"}},
)
try:
method_to_call = getattr(ctx.locator, ctx.method)
Expand Down