fix: use W3C WebDriver text format for element value input - #1
Open
daifma wants to merge 1 commit into
Open
Conversation
Replace legacy JSON Wire Protocol format {"value": ["text"]} with
W3C-compliant {"text": "string"} in postValue() calls.
Selenium 4+ with ChromeDriver requires the W3C format per
https://www.w3.org/TR/webdriver2/#element-send-keys
This fixes setValue(), attachFile(), and file upload when used
with selenium/standalone-chrome containers.
Author
|
@ShuCh3n PLZ review ! |
Author
|
@ShuCh3n ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The driver sends
{"value": ["text"]}(legacy JSON Wire Protocol format) inpostValue()calls,but Selenium 4+ with ChromeDriver requires
{"text": "string"}per theW3C WebDriver specification.
This causes
setValue(),attachFile(), and file upload to silently fail or throw errorswhen used with Selenium 4 standalone Chrome.
Fix
Replace all three occurrences of the legacy format with W3C-compliant format:
How to reproduce
selenium/standalone-chrome:latest(Selenium 4+)ediasoft/mink-selenium4-driver$session->getPage()->fillField('name', 'value'){"value": [...]}payloadReferences
textfield is the W3C-compliant key for sending keystrokes to an element