-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip if selected #604
Skip if selected #604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to ecd7cef in 48 seconds
More details
- Looked at
94
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_NpYpT8zh3f1Z7pU1
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -828,9 +820,16 @@ async def normal_select( | |||
action: actions.SelectOptionAction, | |||
skyvern_element: SkyvernElement, | |||
) -> List[ActionResult]: | |||
try: | |||
current_text = await skyvern_element.get_attr("selected") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from using locator.input_value()
to skyvern_element.get_attr("selected")
might not always reflect the current state of the UI, especially in dynamic web applications. Consider verifying this approach's reliability in handling dynamically updated select elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good point here. Such as if the previous action caused the select value reset, the logic might be wrong. But maybe we can re-do the select in the next step. So it's not a blocker here.
action_result: List[ActionResult] = [] | ||
is_success = False | ||
locator = skyvern_element.locator | ||
locator = skyvern_element.get_locator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoa seems like a big bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? What do you mean? I don't follow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the confusion! Did the old.locator implementation work? If not that's a huge bug! Nice find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh both of them could work. I just refactor it into the same format.
@@ -828,9 +820,16 @@ async def normal_select( | |||
action: actions.SelectOptionAction, | |||
skyvern_element: SkyvernElement, | |||
) -> List[ActionResult]: | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good change. How can the LLM "unselect" an option? Here doing select option on an already selected option would unselect it before, but now that can never be the case right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean unselect before select? I don't understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If llm want to unselect sth. He can return the value represented the "unselect" right? What the problem here?
return [selectOptions, ""]; | ||
} | ||
|
||
return [selectOptions, removeMultipleSpaces(selectedOption.textContent)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the selected value always textContent? could it be the "value" attribute of the element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because when we parse the option. We only use the textContext to represent the value. I think we should be consistent with the logic we do in the option parsing.
if current_text == action.option.label or current_text == action.option.value: | ||
return [ActionSuccess()] | ||
except Exception: | ||
LOG.info("failed to confirm if the select option has been done, force to take the action again.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we say "force to take the action again"? we're not retrying here, are we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
em. if the skip logic failed. we try to select again!
Summary:
Refactored
handle_select_option_action
to check for already selected options innormal_select
and updatedgetSelectOptions
to return the selected option's text.Key points:
handle_select_option_action
inskyvern/webeye/actions/handler.py
to remove the check for already selected options.normal_select
inskyvern/webeye/actions/handler.py
.getSelectOptions
inskyvern/webeye/scraper/domUtils.js
to return the selected option's text along with the options list.selected
attribute inbuildTreeFromBody
inskyvern/webeye/scraper/domUtils.js
.Generated with ❤️ by ellipsis.dev