{"record":{"id":"e01a32ad03a39d52","repo":"SeleniumHQ/selenium","slug":"name-field-name-is-required-but-was-missing","errorCode":null,"errorMessage":"#{name}##{field.name} is required but was missing from the response","messagePattern":"#(.+?)##(.+?) is required but was missing from the response","errorType":"exception","errorClass":"Error::SerializationError","httpStatus":null,"severity":"warning","filePath":"rb/lib/selenium/webdriver/bidi/serialization/record.rb","lineNumber":231,"sourceCode":"            def fixed?(field)\n              !UNSET.equal?(field.fixed)\n            end\n\n            def wire_value(field, json_payload)\n              return field.fixed if fixed?(field)\n              return read(field, json_payload[field.wire_key]) if json_payload.key?(field.wire_key)\n              return UNSET unless field.required\n\n              missing_required(field)\n            end\n\n            # A required field absent from the response is tolerated as omitted (UNSET) and warned, so a\n            # schema ahead of the browser does not block the caller; strict mode (SE_BIDI_STRICT) escalates\n            # to an error for callers who want it. Omitted (UNSET) stays distinct from an explicit null (nil),\n            # which matters for the required-and-nullable fields the schema flags.\n            def missing_required(field)\n              message = \"#{name}##{field.name} is required but was missing from the response\"\n              raise Error::SerializationError, message if Serialization.strict?\n\n              WebDriver.logger.warn(message, id: :bidi_missing_required)\n              UNSET\n            end\n\n            def read(field, raw)\n              if raw.nil?\n                return raw if field.nullable\n\n                raise Error::SerializationError, \"#{name}##{field.name} received null but is not nullable\"\n              end\n              check_shape(field, raw)\n              return Serialization.to_symbol(\"#{name}##{field.name}\", raw, enum_hash(field)) if field.enum\n\n              if field.ref.nil?\n                check_primitive(field, raw) unless field.list\n                return raw\n              end","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/bidi/serialization/record.rb#L213-L249","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nENV['SE_BIDI_STRICT'] = '1'\nbidi.call(...)\n// after\n# omit SE_BIDI_STRICT (default lenient), or:\nWebDriver.logger.ignore(:bidi_missing_required)","handlingStrategy":"validation","validationCode":"# Avoid enabling strict mode unless you can tolerate hard failures on schema drift.\nENV.delete('SE_BIDI_STRICT') if ENV['SE_BIDI_STRICT'] == '1'","typeGuard":null,"tryCatchPattern":"begin\n  record = SomeRecord.from_json(payload)\nrescue Selenium::WebDriver::Error::SerializationError => e\n  raise unless e.message =~ /required but was missing/\n  WebDriver.logger.warn(\"tolerated: #{e.message}\")\nend","preventionTips":["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."],"tags":["bidi","serialization","schema","strict-mode","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}