Skip to content

Automate browser based workflows with AI

Raise screenshot error earlier when page is closed (#1108)

Shuchang Zheng690dd4c2e823
diff --git a/docs/integrations/workato.md b/docs/integrations/workato.md
index 3bcb687cc..211d24270 100644
--- a/docs/integrations/workato.md
+++ b/docs/integrations/workato.md
@@ -1,3 +1,23 @@
+<!-- START doctoc generated TOC please keep comment here to allow auto update -->
+<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
+**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+
+- [title: 'Workato'](#title-workato)
+- [Running a Skyvern Task in Workato](#running-a-skyvern-task-in-workato)
+ - [Setup](#setup)
+ - [Configure](#configure)
+ - [Test](#test)
+- [Running a Skyvern Workflow in Workato](#running-a-skyvern-workflow-in-workato)
+ - [Setup](#setup-1)
+ - [Configure](#configure-1)
+ - [Test](#test-1)
+- [Adding a Previously Ran Task or Workflow in Workato](#adding-a-previously-ran-task-or-workflow-in-workato)
+ - [Setup](#setup-2)
+ - [Configure](#configure-2)
+ - [Test](#test-2)
+
+<!-- END doctoc generated TOC please keep comment here to allow auto update -->
+
---
title: 'Workato'
---
diff --git a/skyvern/webeye/utils/page.py b/skyvern/webeye/utils/page.py
index b15888f4d..3d28e9e57 100644
--- a/skyvern/webeye/utils/page.py
+++ b/skyvern/webeye/utils/page.py
@@ -39,6 +39,8 @@ class SkyvernFrame:
file_path: str | None = None,
timeout: float = SettingsManager.get_settings().BROWSER_LOADING_TIMEOUT_MS,
) -> bytes:
+ if page.is_closed():
+ raise FailedToTakeScreenshot(error_message="Page is closed")
try:
await page.wait_for_load_state(timeout=SettingsManager.get_settings().BROWSER_LOADING_TIMEOUT_MS)
LOG.debug("Page is fully loaded, agent is about to take screenshots")