Skip to content

Commit 67f2a9e

Browse files
Update browser.py
Co-authored-by: Navin Chandra <[email protected]>
1 parent 11e8805 commit 67f2a9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

py/selenium/webdriver/common/bidi/browser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ def from_dict(cls, data: dict) -> "ClientWindowInfo":
133133
if not isinstance(client_window, str):
134134
raise ValueError("clientWindow must be a string")
135135

136-
state = data.get("state")
136+
state = data["state"]
137137
if not isinstance(state, str):
138138
raise ValueError("state must be a string")
139+
if state not in ClientWindowState.VALID_STATES:
140+
raise ValueError(f"Invalid state: {state}. Must be one of {ClientWindowState.VALID_STATES}")
139141

140142
width = data.get("width")
141143
if not isinstance(width, int):

0 commit comments

Comments
 (0)