Skip to content

Conversation

@YunfeiZHAO
Copy link
Collaborator

Description

In Google Flight, we had trouble filling in the destination combobox with the browser toolkit.
This PR is to change the Type action behaviour to first try to fill the text directly (This works for the combobox on Google Flight), if it fails, we try to click first, then fill in the text.

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • [] I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/browser_toolkit_google_flight

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Review Required PR need to be reviewed label Nov 23, 2025
@fengju0213 fengju0213 added this to the Sprint 43 milestone Nov 24, 2025
Copy link
Collaborator

@waleedalzarooni waleedalzarooni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple quick comments @YunfeiZHAO, good job!

Other than the formatting related comments would you mind changing the logic so that the try-catch logic is simpler as there are currently 3 levels of try-catch in a very small section of code.

await element.fill(text, { timeout: 3000, force: true });

} else {
try{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try{
try {

missing space

@YunfeiZHAO
Copy link
Collaborator Author

Just a couple quick comments @YunfeiZHAO, good job!

Other than the formatting related comments would you mind changing the logic so that the try-catch logic is simpler as there are currently 3 levels of try-catch in a very small section of code.

Yeah, let me think about it !

Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @YunfeiZHAO and @nitpicker55555 , a potential issue in the error handling path: when click-then-fill fails, the code catches the error and then clicks the element again at lines 801-809 to trigger dynamic content. However, we've already clicked once during click-then-fill, would this results in an unnecessary double-click which could cause unintended behavior?

@Wendong-Fan Wendong-Fan added Waiting for Update PR has been reviewed, need to be updated based on review comment and removed Review Required PR need to be reviewed labels Nov 26, 2025
@Wendong-Fan
Copy link
Member

added one pr: #3463 @YunfeiZHAO @nitpicker55555

@YunfeiZHAO
Copy link
Collaborator Author

added one pr: #3463 @YunfeiZHAO @nitpicker55555

merged!

Copy link
Collaborator

@ankithsavio ankithsavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue where snapshot changes due to click-first fill, Thanks!

@YunfeiZHAO YunfeiZHAO merged commit 7af55a3 into master Nov 26, 2025
13 checks passed
@YunfeiZHAO YunfeiZHAO deleted the fix/browser_toolkit_google_flight branch November 26, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting for Update PR has been reviewed, need to be updated based on review comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants