Skip to content
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

Deprecate browser-level fill(), type(), check(), uncheck() #933

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

jsfehler
Copy link
Collaborator

@jsfehler jsfehler commented Oct 21, 2021

Solution for:
#8
#162
#684

This PR adds a generic find method to replace the browser level actions. Currently it uses name, so the following are equivalent:

browser.fill('v', 'my_text')
browser.find('v').fill('my_text')

In 2021, find_by_name is significantly less useful than css or xpath. By exposing a generic find with an API for controlling which strategy is used, the browser level methods become unnecessary, but the shorthand style of writing scripts is preserved and made relevant for more people, eg:

browser.set_find_strategy('css')
browser.find('.my_css').click()
browser.find('.another_css').fill('some_text')

This also removes any need to deprecate find_by_x methods.

Roadmap:
#933

  • Deprecate browser level actions
  • Add generic find() method, defaults to find_by_name
  • Add set_find_strategy() method to set find method. Allow name, xpath, css

Future:

  • Remove browser level actions
  • Default generic find to xpath, remove name
  • Update documentation
  • Write find() method tutorial

@jsfehler jsfehler force-pushed the refactor_form_methods branch 2 times, most recently from d6d1d98 to 6fdf8af Compare October 21, 2021 15:40
@jsfehler jsfehler force-pushed the refactor_form_methods branch 2 times, most recently from 6471c3f to 105c2ed Compare June 24, 2022 00:35
@jsfehler jsfehler force-pushed the refactor_form_methods branch from b3fbb2e to b4ec05b Compare January 18, 2023 20:41
@jsfehler jsfehler force-pushed the refactor_form_methods branch 2 times, most recently from 98cc37a to e819d23 Compare February 13, 2024 16:15
@jsfehler jsfehler force-pushed the refactor_form_methods branch from 8de8ce6 to f140218 Compare February 13, 2024 16:22
@jsfehler jsfehler merged commit 69749e5 into cobrateam:master Feb 13, 2024
26 checks passed
@jsfehler jsfehler deleted the refactor_form_methods branch February 13, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants