Skip to content

Commit

Permalink
[py]: set exception direct cause when switching frame focus when NSE …
Browse files Browse the repository at this point in the history
…is raised
  • Loading branch information
symonk committed Jul 24, 2023
1 parent d90f7ba commit 882afba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/selenium/webdriver/remote/switch_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def frame(self, frame_reference: Union[str, int, WebElement]) -> None:
except NoSuchElementException:
try:
frame_reference = self._driver.find_element(By.NAME, frame_reference)
except NoSuchElementException:
raise NoSuchFrameException(frame_reference)
except NoSuchElementException as exc:
raise NoSuchFrameException(frame_reference) from exc

self._driver.execute(Command.SWITCH_TO_FRAME, {"id": frame_reference})

Expand Down

0 comments on commit 882afba

Please sign in to comment.