fix input on blocking element issue (#3500)

This commit is contained in:
pedrohsdb
2025-09-22 14:03:37 -07:00
committed by GitHub
parent 1a657b1587
commit 10fac9bad0
2 changed files with 14 additions and 1 deletions

View File

@@ -1178,7 +1178,9 @@ async def handle_input_text_action(
LOG.warning(
"Find a blocking element to the current element, going to input on the blocking element",
)
skyvern_element = blocking_element
if await blocking_element.is_editable():
skyvern_element = blocking_element
tag_name = blocking_element.get_tag_name()
except Exception:
LOG.info(
"Failed to find the blocking element, continue with the original element",

View File

@@ -285,6 +285,17 @@ class SkyvernElement:
skyvern_frame = await SkyvernFrame.create_instance(self.get_frame())
return await skyvern_frame.get_element_visible(await self.get_element_handler())
async def is_editable(self, timeout: float = settings.BROWSER_ACTION_TIMEOUT_MS) -> bool:
try:
return await self.get_locator().is_editable(timeout=timeout)
except Exception:
LOG.info(
"Failed to check element editable, considering it's not editable",
exc_info=True,
element_id=self.get_id(),
)
return False
async def is_parent_of(self, target: ElementHandle) -> bool:
skyvern_frame = await SkyvernFrame.create_instance(self.get_frame())
return await skyvern_frame.is_parent(await self.get_element_handler(), target)