-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add ability to save autofill data and trigger autofill on form elements #1796
Comments
@jgraham @whimboo @gsnedders WDYT? |
The idea seems valid. Let's discuss specifics:
|
Thanks for all the great questions @galich! Here some thoughts...
|
Form submit should work across all browsers, but what if browser asks a confirmation from user before saving data? We need some way to do "form submit with a flag to automatically accept saving an address". May be browsers could autosave when operating by web driver.
Sounds like "what was filled" part to me. I'm assuming we expect only 1 entry that can be filled or API would specify which address entry to fill?
On top of my head, and @DimiDL can probably suggest more, we may want to specify from which iframe and which input the autofill is triggered. Also would be curious to see what happens when there are multiple forms across iframes with reused input names.
++ to making it not-address specific. |
With regard to filling: I am not particularly familiar with WebDriver but would it make sense to to pass a WebElement (API) for the trigger field instead of an id? With regard to saving: I think that both approaches, 1) explicitly saving the values and 2) simulating a save that would be triggered by a form submission would be useful. I think that 1) would be simpler and possibly more inclusive (I don't know whether all user agents offer a save-on-submission feature). I would still like to see and could imagine a simple API that says "on next form submission save automatically". |
This is fundamentally what the design is; the ID is how Selenium's WebElement's get communicated over the wire. It's not what DOM considers IDs—it's a WebDriver specific ID. |
Yeah, I was thinking they'd autosave in testing scenarios.
@OrKoN made some relevant suggestions on w3c/webdriver-bidi#706 (comment) From my perspective a single entry would be fine, but I'm cool with expanding the flow to enable the test script to choose which.
Again, @OrKoN made similar comments on w3c/webdriver-bidi#706 (comment) Should we perhaps coalesce design efforts on one of these? |
Problem
Currently there is no way for developers to automate autofill in browsers and thus they can't test their HTML with the browser's autofill behaviour. Adding such an API would allow such testing and enable developers to write automated autofill tests (e.g. WPT).
Proposal
We are proposing to add 2 new end points to webdriver:
Endpoint /session/{session id}/autofill/save
This endpoint can be used to save an address in the autofill manager of the browser which is necessary to set up any automated tests. It should take a JSON object as input with the keys being the field name and the values being the actual value for that field.
Endpoint /session/{session id}/autofill/trigger
This endpoint will be used to trigger the autofill behaviour on a specific input field, similar to how a user would do it when using the browser manually. It should take the field's
id
attribute as parameter to specify which input field autofill should be triggered on.The text was updated successfully, but these errors were encountered: