Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
fix(SKY-9511): make MoveAction/ScrollAction coords optional (#5821)
Celal Zamanoğlu71f87c3e2c60
diff --git a/skyvern/webeye/actions/actions.py b/skyvern/webeye/actions/actions.pyindex dbd33474f..3ea88725b 100644--- a/skyvern/webeye/actions/actions.py+++ b/skyvern/webeye/actions/actions.py@@ -351,8 +351,8 @@ class ScrollAction(Action):action_type: ActionType = ActionType.SCROLLx: int | None = Noney: int | None = None- scroll_x: int- scroll_y: int+ scroll_x: int | None = None+ scroll_y: int | None = Noneclass KeypressAction(Action):@@ -370,8 +370,8 @@ class GotoUrlAction(Action):class MoveAction(Action):action_type: ActionType = ActionType.MOVE- x: int- y: int+ x: int | None = None+ y: int | None = Noneclass DragAction(Action):diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.pyindex 540851e97..ea2276500 100644--- a/skyvern/webeye/actions/handler.py+++ b/skyvern/webeye/actions/handler.py@@ -2373,6 +2373,8 @@ async def handle_scroll_action(task: Task,step: Step,) -> list[ActionResult]:+ if action.scroll_x is None or action.scroll_y is None:+ return [ActionFailure(Exception("ScrollAction is missing scroll_x/scroll_y coordinates"))]if action.element_id:# Element-based scrolling from extract-action prompt. Uses# scrollNearestScrollableContainer() from domUtils.js which walks the DOM to find@@ -2499,6 +2501,8 @@ async def handle_move_action(task: Task,step: Step,) -> list[ActionResult]:+ if action.x is None or action.y is None:+ return [ActionFailure(Exception("MoveAction is missing x/y coordinates"))]await EventStrategyFactory.move_cursor(page, action.x, action.y)return [ActionSuccess()]