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
2 changes: 1 addition & 1 deletion py/selenium/webdriver/ie/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,4 @@ def to_capabilities(self) -> dict:

@property
def default_capabilities(self) -> dict:
return DesiredCapabilities.INTERNETEXPLORER.copy()
return DesiredCapabilities.INTERNETEXPLORER.copy()
13 changes: 8 additions & 5 deletions py/selenium/webdriver/remote/switch_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +29,7 @@


class SwitchTo:
def __init__(self, driver):
def __init__(self, driver) -> None:
import weakref

self._driver = weakref.proxy(driver)
Expand Down Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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})

Expand Down