Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions py/selenium/webdriver/remote/shadowroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __repr__(self) -> str:
def id(self) -> str:
return self._id

def find_element(self, by: str = By.ID, value: str | None = None) -> WebElement:
def find_element(self, by: str | By = By.ID, value: str | None = None) -> WebElement:
"""Find an element inside a shadow root given a By strategy and locator.

Args:
Expand Down Expand Up @@ -87,7 +87,7 @@ def find_element(self, by: str = By.ID, value: str | None = None) -> WebElement:

return self._execute(Command.FIND_ELEMENT_FROM_SHADOW_ROOT, {"using": by, "value": value})["value"]

def find_elements(self, by: str = By.ID, value: str | None = None) -> list[WebElement]:
def find_elements(self, by: str | By = By.ID, value: str | None = None) -> list[WebElement]:
"""Find elements inside a shadow root given a By strategy and locator.

Args:
Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/remote/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def timeouts(self, timeouts) -> None:
"""
_ = self.execute(Command.SET_TIMEOUTS, timeouts._to_json())["value"]

def find_element(self, by: str | RelativeBy = By.ID, value: str | None = None) -> WebElement:
def find_element(self, by: str | By | RelativeBy = By.ID, value: str | None = None) -> WebElement:
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
"""Find an element given a By strategy and locator.

Args:
Expand All @@ -910,7 +910,7 @@ def find_element(self, by: str | RelativeBy = By.ID, value: str | None = None) -

return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]

def find_elements(self, by: str | RelativeBy = By.ID, value: str | None = None) -> list[WebElement]:
def find_elements(self, by: str | By | RelativeBy = By.ID, value: str | None = None) -> list[WebElement]:
"""Find elements given a By strategy and locator.

Args:
Expand Down
4 changes: 2 additions & 2 deletions py/selenium/webdriver/remote/webelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def _execute(self, command, params=None):
params["id"] = self._id
return self._parent.execute(command, params)

def find_element(self, by: str = By.ID, value: str | None = None) -> WebElement:
def find_element(self, by: str | By = By.ID, value: str | None = None) -> WebElement:
"""Find an element given a By strategy and locator.

Args:
Expand All @@ -531,7 +531,7 @@ def find_element(self, by: str = By.ID, value: str | None = None) -> WebElement:
by, value = self._parent.locator_converter.convert(by, value)
return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]

def find_elements(self, by: str = By.ID, value: str | None = None) -> list[WebElement]:
def find_elements(self, by: str | By = By.ID, value: str | None = None) -> list[WebElement]:
"""Find elements given a By strategy and locator.

Args:
Expand Down
Loading