SeleniumHQ/selenium · warning · Error::SerializationError
#{name}##{field.name} is required but was missing from the r
Error message
#{name}##{field.name} is required but was missing from the response What it means
A required BiDi Record field was absent from the response. By default (lenient mode) this is only warned and treated as omitted (UNSET), so a schema ahead of the browser does not block callers. With the SE_BIDI_STRICT env var set, the same condition escalates to Error::SerializationError. This keeps required-but-missing distinct from an explicit null.
Source
Thrown at rb/lib/selenium/webdriver/bidi/serialization/record.rb:231
def fixed?(field)
!UNSET.equal?(field.fixed)
end
def wire_value(field, json_payload)
return field.fixed if fixed?(field)
return read(field, json_payload[field.wire_key]) if json_payload.key?(field.wire_key)
return UNSET unless field.required
missing_required(field)
end
# A required field absent from the response is tolerated as omitted (UNSET) and warned, so a
# schema ahead of the browser does not block the caller; strict mode (SE_BIDI_STRICT) escalates
# to an error for callers who want it. Omitted (UNSET) stays distinct from an explicit null (nil),
# which matters for the required-and-nullable fields the schema flags.
def missing_required(field)
message = "#{name}##{field.name} is required but was missing from the response"
raise Error::SerializationError, message if Serialization.strict?
WebDriver.logger.warn(message, id: :bidi_missing_required)
UNSET
end
def read(field, raw)
if raw.nil?
return raw if field.nullable
raise Error::SerializationError, "#{name}##{field.name} received null but is not nullable"
end
check_shape(field, raw)
return Serialization.to_symbol("#{name}##{field.name}", raw, enum_hash(field)) if field.enum
if field.ref.nil?
check_primitive(field, raw) unless field.list
return raw
endView on GitHub (pinned to aa36b38e69)
Solutions
- Unset SE_BIDI_STRICT to downgrade to a warning if the missing field is non-critical.
- Align browser/driver and Selenium versions so the required field is emitted.
- Filter the :bidi_missing_required warning via WebDriver.logger.ignore(:bidi_missing_required) if intentional.
- Report the missing-field divergence with the response payload.
Example fix
// before ENV['SE_BIDI_STRICT'] = '1' bidi.call(...) // after # omit SE_BIDI_STRICT (default lenient), or: WebDriver.logger.ignore(:bidi_missing_required)
Defensive patterns
Strategy: validation
Validate before calling
# Avoid enabling strict mode unless you can tolerate hard failures on schema drift.
ENV.delete('SE_BIDI_STRICT') if ENV['SE_BIDI_STRICT'] == '1' Try / catch
begin
record = SomeRecord.from_json(payload)
rescue Selenium::WebDriver::Error::SerializationError => e
raise unless e.message =~ /required but was missing/
WebDriver.logger.warn("tolerated: #{e.message}")
end Prevention
- Do not set SE_BIDI_STRICT in CI unless you also pin matching browser versions.
- Silence known-benign missing fields via WebDriver.logger.ignore(:bidi_missing_required).
- Track schema drift between Selenium and the target browser in your test matrix.
When it happens
Trigger: A BiDi response omits a field the schema marks required. Only raises when SE_BIDI_STRICT is enabled; otherwise logs a :bidi_missing_required warning and returns UNSET.
Common situations: Running tests/binary with SE_BIDI_STRICT=1, older browser that does not yet emit the field, newer Selenium schema adding a required field the browser has not shipped, grid stripping fields.
Related errors
- #{name} expected an object on the wire, got #{json_payload.i
- #{name}##{field.name} received null but is not nullable
- #{name}##{field.name} expected #{field.list ? 'a list' : 'a
- #{name}##{field.name} expected #{field.primitive}, got #{raw
- #{name}##{field.name} expected a [key, value] pair, got #{el
AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14).
Data as JSON: /api/errors/e01a32ad03a39d52.
Report an issue: GitHub.