diff --git a/py/selenium/webdriver/ie/options.py b/py/selenium/webdriver/ie/options.py index e64f41127b2cb..94b56f40a2f89 100644 --- a/py/selenium/webdriver/ie/options.py +++ b/py/selenium/webdriver/ie/options.py @@ -387,4 +387,4 @@ def to_capabilities(self) -> dict: @property def default_capabilities(self) -> dict: - return DesiredCapabilities.INTERNETEXPLORER.copy() \ No newline at end of file + return DesiredCapabilities.INTERNETEXPLORER.copy() diff --git a/py/selenium/webdriver/remote/switch_to.py b/py/selenium/webdriver/remote/switch_to.py index cc2f686f0e38e..4621b111a24d5 100644 --- a/py/selenium/webdriver/remote/switch_to.py +++ b/py/selenium/webdriver/remote/switch_to.py @@ -15,6 +15,9 @@ # specific language governing permissions and limitations # under the License. +from typing import Optional +from typing import Union + from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoSuchFrameException from selenium.common.exceptions import NoSuchWindowException @@ -26,7 +29,7 @@ class SwitchTo: - def __init__(self, driver): + def __init__(self, driver) -> None: import weakref self._driver = weakref.proxy(driver) @@ -65,7 +68,7 @@ def default_content(self) -> None: """ self._driver.execute(Command.SWITCH_TO_FRAME, {"id": None}) - def frame(self, frame_reference) -> None: + def frame(self, frame_reference: Union[str, int, WebElement]) -> None: """Switches focus to the specified frame, by index, name, or webelement. @@ -91,7 +94,7 @@ def frame(self, frame_reference) -> None: self._driver.execute(Command.SWITCH_TO_FRAME, {"id": frame_reference}) - def new_window(self, type_hint=None) -> None: + def new_window(self, type_hint: Optional[str] = None) -> None: """Switches to a new top-level browsing context. The type hint can be one of "tab" or "window". If not specified the @@ -116,7 +119,7 @@ def parent_frame(self) -> None: """ self._driver.execute(Command.SWITCH_TO_PARENT_FRAME) - def window(self, window_name) -> None: + def window(self, window_name: str) -> None: """Switches focus to the specified window. :Args: @@ -129,7 +132,7 @@ def window(self, window_name) -> None: """ self._w3c_window(window_name) - def _w3c_window(self, window_name): + def _w3c_window(self, window_name: str) -> None: def send_handle(h): self._driver.execute(Command.SWITCH_TO_WINDOW, {"handle": h})