fix input on blocking element issue (#3500)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user