| 402 | raise |
| 403 | |
| 404 | def _wrap_value(self, value): |
| 405 | if isinstance(value, dict): |
| 406 | converted = {} |
| 407 | for key, val in value.items(): |
| 408 | converted[key] = self._wrap_value(val) |
| 409 | return converted |
| 410 | if isinstance(value, self._web_element_cls): |
| 411 | return {"element-6066-11e4-a52e-4f735466cecf": value.id} |
| 412 | if isinstance(value, self._shadowroot_cls): |
| 413 | return {"shadow-6066-11e4-a52e-4f735466cecf": value.id} |
| 414 | if isinstance(value, list): |
| 415 | return list(self._wrap_value(item) for item in value) |
| 416 | return value |
| 417 | |
| 418 | def create_web_element(self, element_id: str) -> WebElement: |
| 419 | """Creates a web element with the specified `element_id`.""" |