Stubs for selenium (#5792)

These were generated using stubgen, with manual fixes. I tried to remove
exported names that are clearly not part of the public interface, but in many
cases this wasn't obvious so I left the exports, just in case.

I had to do major changes to exported names in `selenium.webdriver` to 
make it work as expected (this was originally implemented by @ilevkivskyi 
in our internal stubs).

Selenium has been working on adding inline type annotations, but it's not clear
when these will be released. The release will be 4.x, and having stubs for 3.x 
could still be valuable for users on older versions.
This commit is contained in:
Jukka Lehtosalo
2021-07-24 21:43:24 +01:00
committed by GitHub
parent 7c5d76aca0
commit 1ad4b79139
87 changed files with 1886 additions and 0 deletions

View File

@@ -56,6 +56,7 @@
"stubs/PyYAML",
"stubs/redis",
"stubs/requests",
"stubs/selenium",
"stubs/simplejson",
"stubs/slumber",
"stubs/stripe",

View File

@@ -0,0 +1 @@
version = "3.141"

View File

View File

@@ -0,0 +1 @@
from . import exceptions as exceptions

View File

@@ -0,0 +1,49 @@
from typing import Any
class WebDriverException(Exception):
msg: Any
screen: Any
stacktrace: Any
def __init__(self, msg: Any | None = ..., screen: Any | None = ..., stacktrace: Any | None = ...) -> None: ...
class ErrorInResponseException(WebDriverException):
response: Any
def __init__(self, response, msg) -> None: ...
class InvalidSwitchToTargetException(WebDriverException): ...
class NoSuchFrameException(InvalidSwitchToTargetException): ...
class NoSuchWindowException(InvalidSwitchToTargetException): ...
class NoSuchElementException(WebDriverException): ...
class NoSuchAttributeException(WebDriverException): ...
class StaleElementReferenceException(WebDriverException): ...
class InvalidElementStateException(WebDriverException): ...
class UnexpectedAlertPresentException(WebDriverException):
alert_text: Any
def __init__(
self, msg: Any | None = ..., screen: Any | None = ..., stacktrace: Any | None = ..., alert_text: Any | None = ...
) -> None: ...
class NoAlertPresentException(WebDriverException): ...
class ElementNotVisibleException(InvalidElementStateException): ...
class ElementNotInteractableException(InvalidElementStateException): ...
class ElementNotSelectableException(InvalidElementStateException): ...
class InvalidCookieDomainException(WebDriverException): ...
class UnableToSetCookieException(WebDriverException): ...
class RemoteDriverServerException(WebDriverException): ...
class TimeoutException(WebDriverException): ...
class MoveTargetOutOfBoundsException(WebDriverException): ...
class UnexpectedTagNameException(WebDriverException): ...
class InvalidSelectorException(NoSuchElementException): ...
class ImeNotAvailableException(WebDriverException): ...
class ImeActivationFailedException(WebDriverException): ...
class InvalidArgumentException(WebDriverException): ...
class JavascriptException(WebDriverException): ...
class NoSuchCookieException(WebDriverException): ...
class ScreenshotException(WebDriverException): ...
class ElementClickInterceptedException(WebDriverException): ...
class InsecureCertificateException(WebDriverException): ...
class InvalidCoordinatesException(WebDriverException): ...
class InvalidSessionIdException(WebDriverException): ...
class SessionNotCreatedException(WebDriverException): ...
class UnknownMethodException(WebDriverException): ...

View File

@@ -0,0 +1,45 @@
from .android.webdriver import WebDriver as Android
from .blackberry.webdriver import WebDriver as BlackBerry
from .chrome.options import Options as ChromeOptions
from .chrome.webdriver import WebDriver as Chrome
from .common.action_chains import ActionChains as ActionChains
from .common.desired_capabilities import DesiredCapabilities as DesiredCapabilities
from .common.proxy import Proxy as Proxy
from .common.touch_actions import TouchActions as TouchActions
from .edge.webdriver import WebDriver as Edge
from .firefox.firefox_profile import FirefoxProfile as FirefoxProfile
from .firefox.options import Options as FirefoxOptions
from .firefox.webdriver import WebDriver as Firefox
from .ie.options import Options as IeOptions
from .ie.webdriver import WebDriver as Ie
from .opera.webdriver import WebDriver as Opera
from .phantomjs.webdriver import WebDriver as PhantomJS
from .remote.webdriver import WebDriver as Remote
from .safari.webdriver import WebDriver as Safari
from .webkitgtk.options import Options as WebKitGTKOptions
from .webkitgtk.webdriver import WebDriver as WebKitGTK
# We need an explicit __all__ because some of the above won't otherwise be exported.
__all__ = [
"Firefox",
"FirefoxProfile",
"FirefoxOptions",
"Chrome",
"ChromeOptions",
"Ie",
"IeOptions",
"Edge",
"EdgeOptions",
"Opera",
"Safari",
"BlackBerry",
"PhantomJS",
"Android",
"WebKitGTK",
"WebKitGTKOptions",
"Remote",
"DesiredCapabilities",
"ActionChains",
"TouchActions",
"Proxy",
]

View File

@@ -0,0 +1,5 @@
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities as DesiredCapabilities
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
class WebDriver(RemoteWebDriver):
def __init__(self, host: str = ..., port: int = ..., desired_capabilities=...) -> None: ...

View File

@@ -0,0 +1,11 @@
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
LOAD_TIMEOUT: int
class WebDriver(RemoteWebDriver):
def __init__(
self, device_password, bb_tools_dir: Any | None = ..., hostip: str = ..., port: int = ..., desired_capabilities=...
): ...
def quit(self) -> None: ...

View File

@@ -0,0 +1,30 @@
class Options:
KEY: str
def __init__(self) -> None: ...
@property
def binary_location(self): ...
@binary_location.setter
def binary_location(self, value) -> None: ...
@property
def capabilities(self): ...
def set_capability(self, name, value) -> None: ...
@property
def debugger_address(self): ...
@debugger_address.setter
def debugger_address(self, value) -> None: ...
@property
def arguments(self): ...
def add_argument(self, argument) -> None: ...
@property
def extensions(self): ...
def add_extension(self, extension) -> None: ...
def add_encoded_extension(self, extension) -> None: ...
@property
def experimental_options(self): ...
def add_experimental_option(self, name, value) -> None: ...
@property
def headless(self): ...
@headless.setter
def headless(self, value) -> None: ...
def set_headless(self, headless: bool = ...) -> None: ...
def to_capabilities(self): ...

View File

@@ -0,0 +1,4 @@
from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection
class ChromeRemoteConnection(RemoteConnection):
def __init__(self, remote_server_addr, keep_alive: bool = ...) -> None: ...

View File

@@ -0,0 +1,10 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
service_args: Any
def __init__(
self, executable_path, port: int = ..., service_args: Any | None = ..., log_path: Any | None = ..., env: Any | None = ...
) -> None: ...
def command_line_args(self): ...

View File

@@ -0,0 +1,25 @@
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .remote_connection import ChromeRemoteConnection as ChromeRemoteConnection
class WebDriver(RemoteWebDriver):
service: Any
def __init__(
self,
executable_path: str = ...,
port: int = ...,
options: Any | None = ...,
service_args: Any | None = ...,
desired_capabilities: Any | None = ...,
service_log_path: Any | None = ...,
chrome_options: Any | None = ...,
keep_alive: bool = ...,
) -> None: ...
def launch_app(self, id): ...
def get_network_conditions(self): ...
def set_network_conditions(self, **network_conditions) -> None: ...
def execute_cdp_cmd(self, cmd, cmd_args): ...
def quit(self) -> None: ...
def create_options(self): ...

View File

@@ -0,0 +1,29 @@
from typing import Any
from selenium.webdriver.remote.command import Command as Command
from .actions.action_builder import ActionBuilder as ActionBuilder
from .utils import keys_to_typing as keys_to_typing
class ActionChains:
w3c_actions: Any
def __init__(self, driver) -> None: ...
def perform(self) -> None: ...
def reset_actions(self) -> None: ...
def click(self, on_element: Any | None = ...): ...
def click_and_hold(self, on_element: Any | None = ...): ...
def context_click(self, on_element: Any | None = ...): ...
def double_click(self, on_element: Any | None = ...): ...
def drag_and_drop(self, source, target): ...
def drag_and_drop_by_offset(self, source, xoffset, yoffset): ...
def key_down(self, value, element: Any | None = ...): ...
def key_up(self, value, element: Any | None = ...): ...
def move_by_offset(self, xoffset, yoffset): ...
def move_to_element(self, to_element): ...
def move_to_element_with_offset(self, to_element, xoffset, yoffset): ...
def pause(self, seconds): ...
def release(self, on_element: Any | None = ...): ...
def send_keys(self, *keys_to_send): ...
def send_keys_to_element(self, element, *keys_to_send): ...
def __enter__(self): ...
def __exit__(self, _type, _value, _traceback) -> None: ...

View File

@@ -0,0 +1,27 @@
from typing import Any
from selenium.webdriver.remote.command import Command as Command
from . import interaction as interaction
from .key_actions import KeyActions as KeyActions
from .key_input import KeyInput as KeyInput
from .pointer_actions import PointerActions as PointerActions
from .pointer_input import PointerInput as PointerInput
class ActionBuilder:
devices: Any
driver: Any
def __init__(self, driver, mouse: Any | None = ..., keyboard: Any | None = ...) -> None: ...
def get_device_with(self, name): ...
@property
def pointer_inputs(self): ...
@property
def key_inputs(self): ...
@property
def key_action(self): ...
@property
def pointer_action(self): ...
def add_key_input(self, name): ...
def add_pointer_input(self, kind, name): ...
def perform(self) -> None: ...
def clear_actions(self) -> None: ...

View File

@@ -0,0 +1,9 @@
from typing import Any
class InputDevice:
name: Any
actions: Any
def __init__(self, name: Any | None = ...) -> None: ...
def add_action(self, action) -> None: ...
def clear_actions(self) -> None: ...
def create_pause(self, duraton: int = ...) -> None: ...

View File

@@ -0,0 +1,21 @@
from typing import Any
KEY: str
POINTER: str
NONE: str
SOURCE_TYPES: Any
POINTER_MOUSE: str
POINTER_TOUCH: str
POINTER_PEN: str
POINTER_KINDS: Any
class Interaction:
PAUSE: str
source: Any
def __init__(self, source) -> None: ...
class Pause(Interaction):
source: Any
duration: Any
def __init__(self, source, duration: int = ...) -> None: ...
def encode(self): ...

View File

@@ -0,0 +1,13 @@
from typing import Any
from ..utils import keys_to_typing as keys_to_typing
from .interaction import KEY as KEY, Interaction as Interaction
from .key_input import KeyInput as KeyInput
class KeyActions(Interaction):
source: Any
def __init__(self, source: Any | None = ...) -> None: ...
def key_down(self, letter): ...
def key_up(self, letter): ...
def pause(self, duration: int = ...): ...
def send_keys(self, text): ...

View File

@@ -0,0 +1,20 @@
from typing import Any
from . import interaction as interaction
from .input_device import InputDevice as InputDevice
from .interaction import Interaction as Interaction, Pause as Pause
class KeyInput(InputDevice):
name: Any
type: Any
def __init__(self, name) -> None: ...
def encode(self): ...
def create_key_down(self, key) -> None: ...
def create_key_up(self, key) -> None: ...
def create_pause(self, pause_duration: int = ...) -> None: ...
class TypingInteraction(Interaction):
type: Any
key: Any
def __init__(self, source, type_, key) -> None: ...
def encode(self): ...

View File

@@ -0,0 +1,4 @@
class MouseButton:
LEFT: int
MIDDLE: int
RIGHT: int

View File

@@ -0,0 +1,23 @@
from typing import Any
from selenium.webdriver.remote.webelement import WebElement as WebElement
from . import interaction as interaction
from .interaction import Interaction as Interaction
from .mouse_button import MouseButton as MouseButton
from .pointer_input import PointerInput as PointerInput
class PointerActions(Interaction):
source: Any
def __init__(self, source: Any | None = ...) -> None: ...
def pointer_down(self, button=...) -> None: ...
def pointer_up(self, button=...) -> None: ...
def move_to(self, element, x: Any | None = ..., y: Any | None = ...): ...
def move_by(self, x, y): ...
def move_to_location(self, x, y): ...
def click(self, element: Any | None = ...): ...
def context_click(self, element: Any | None = ...): ...
def click_and_hold(self, element: Any | None = ...): ...
def release(self): ...
def double_click(self, element: Any | None = ...) -> None: ...
def pause(self, duration: int = ...): ...

View File

@@ -0,0 +1,17 @@
from typing import Any
from .input_device import InputDevice as InputDevice
from .interaction import POINTER as POINTER, POINTER_KINDS as POINTER_KINDS
class PointerInput(InputDevice):
DEFAULT_MOVE_DURATION: int
type: Any
kind: Any
name: Any
def __init__(self, kind, name) -> None: ...
def create_pointer_move(self, duration=..., x: Any | None = ..., y: Any | None = ..., origin: Any | None = ...) -> None: ...
def create_pointer_down(self, button) -> None: ...
def create_pointer_up(self, button) -> None: ...
def create_pointer_cancel(self) -> None: ...
def create_pause(self, pause_duration) -> None: ... # type: ignore
def encode(self): ...

View File

@@ -0,0 +1,10 @@
from typing import Any
class Alert:
driver: Any
def __init__(self, driver) -> None: ...
@property
def text(self): ...
def dismiss(self) -> None: ...
def accept(self) -> None: ...
def send_keys(self, keysToSend) -> None: ...

View File

@@ -0,0 +1,9 @@
class By:
ID: str
XPATH: str
LINK_TEXT: str
PARTIAL_LINK_TEXT: str
NAME: str
TAG_NAME: str
CLASS_NAME: str
CSS_SELECTOR: str

View File

@@ -0,0 +1,16 @@
from typing import Any
class DesiredCapabilities:
FIREFOX: Any
INTERNETEXPLORER: Any
EDGE: Any
CHROME: Any
OPERA: Any
SAFARI: Any
HTMLUNIT: Any
HTMLUNITWITHJS: Any
IPHONE: Any
IPAD: Any
ANDROID: Any
PHANTOMJS: Any
WEBKITGTK: Any

View File

@@ -0,0 +1,13 @@
from typing import Any
class ApplicationCache:
UNCACHED: int
IDLE: int
CHECKING: int
DOWNLOADING: int
UPDATE_READY: int
OBSOLETE: int
driver: Any
def __init__(self, driver) -> None: ...
@property
def status(self): ...

View File

@@ -0,0 +1,67 @@
from typing import Any
class Keys:
NULL: str
CANCEL: str
HELP: str
BACKSPACE: str
BACK_SPACE: Any
TAB: str
CLEAR: str
RETURN: str
ENTER: str
SHIFT: str
LEFT_SHIFT: Any
CONTROL: str
LEFT_CONTROL: Any
ALT: str
LEFT_ALT: Any
PAUSE: str
ESCAPE: str
SPACE: str
PAGE_UP: str
PAGE_DOWN: str
END: str
HOME: str
LEFT: str
ARROW_LEFT: Any
UP: str
ARROW_UP: Any
RIGHT: str
ARROW_RIGHT: Any
DOWN: str
ARROW_DOWN: Any
INSERT: str
DELETE: str
SEMICOLON: str
EQUALS: str
NUMPAD0: str
NUMPAD1: str
NUMPAD2: str
NUMPAD3: str
NUMPAD4: str
NUMPAD5: str
NUMPAD6: str
NUMPAD7: str
NUMPAD8: str
NUMPAD9: str
MULTIPLY: str
ADD: str
SEPARATOR: str
SUBTRACT: str
DECIMAL: str
DIVIDE: str
F1: str
F2: str
F3: str
F4: str
F5: str
F6: str
F7: str
F8: str
F9: str
F10: str
F11: str
F12: str
META: str
COMMAND: str

View File

@@ -0,0 +1,70 @@
from typing import Any
class ProxyTypeFactory:
@staticmethod
def make(ff_value, string): ...
class ProxyType:
DIRECT: Any
MANUAL: Any
PAC: Any
RESERVED_1: Any
AUTODETECT: Any
SYSTEM: Any
UNSPECIFIED: Any
@classmethod
def load(cls, value): ...
class Proxy:
proxyType: Any
autodetect: bool
ftpProxy: str
httpProxy: str
noProxy: str
proxyAutoconfigUrl: str
sslProxy: str
socksProxy: str
socksUsername: str
socksPassword: str
def __init__(self, raw: Any | None = ...) -> None: ...
@property
def proxy_type(self): ...
@proxy_type.setter
def proxy_type(self, value) -> None: ...
@property
def auto_detect(self): ...
@auto_detect.setter
def auto_detect(self, value) -> None: ...
@property
def ftp_proxy(self): ...
@ftp_proxy.setter
def ftp_proxy(self, value) -> None: ...
@property
def http_proxy(self): ...
@http_proxy.setter
def http_proxy(self, value) -> None: ...
@property
def no_proxy(self): ...
@no_proxy.setter
def no_proxy(self, value) -> None: ...
@property
def proxy_autoconfig_url(self): ...
@proxy_autoconfig_url.setter
def proxy_autoconfig_url(self, value) -> None: ...
@property
def ssl_proxy(self): ...
@ssl_proxy.setter
def ssl_proxy(self, value) -> None: ...
@property
def socks_proxy(self): ...
@socks_proxy.setter
def socks_proxy(self, value) -> None: ...
@property
def socks_username(self): ...
@socks_username.setter
def socks_username(self, value) -> None: ...
@property
def socks_password(self): ...
@socks_password.setter
def socks_password(self, value) -> None: ...
def add_to_capabilities(self, capabilities) -> None: ...

View File

@@ -0,0 +1,21 @@
from typing import Any
class Service:
path: Any
port: Any
start_error_message: Any
log_file: Any
env: Any
def __init__(
self, executable, port: int = ..., log_file=..., env: Any | None = ..., start_error_message: str = ...
) -> None: ...
@property
def service_url(self): ...
def command_line_args(self) -> None: ...
process: Any
def start(self) -> None: ...
def assert_process_still_running(self) -> None: ...
def is_connectable(self): ...
def send_remote_shutdown_command(self) -> None: ...
def stop(self) -> None: ...
def __del__(self) -> None: ...

View File

@@ -0,0 +1,15 @@
class TouchActions:
def __init__(self, driver) -> None: ...
def perform(self) -> None: ...
def tap(self, on_element): ...
def double_tap(self, on_element): ...
def tap_and_hold(self, xcoord, ycoord): ...
def move(self, xcoord, ycoord): ...
def release(self, xcoord, ycoord): ...
def scroll(self, xoffset, yoffset): ...
def scroll_from_element(self, on_element, xoffset, yoffset): ...
def long_press(self, on_element): ...
def flick(self, xspeed, yspeed): ...
def flick_element(self, on_element, xoffset, yoffset, speed): ...
def __enter__(self): ...
def __exit__(self, _type, _value, _traceback) -> None: ...

View File

@@ -0,0 +1,12 @@
from typing import Any
from selenium.webdriver.common.keys import Keys as Keys
basestring = str
def free_port(): ...
def find_connectable_ip(host, port: Any | None = ...): ...
def join_host_port(host, port): ...
def is_connectable(port, host: str = ...): ...
def is_url_connectable(port): ...
def keys_to_typing(value): ...

View File

@@ -0,0 +1,10 @@
class Options:
def __init__(self) -> None: ...
@property
def page_load_strategy(self): ...
@page_load_strategy.setter
def page_load_strategy(self, value) -> None: ...
@property
def capabilities(self): ...
def set_capability(self, name, value) -> None: ...
def to_capabilities(self): ...

View File

@@ -0,0 +1,8 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
service_args: Any
def __init__(self, executable_path, port: int = ..., verbose: bool = ..., log_path: Any | None = ...) -> None: ...
def command_line_args(self): ...

View File

@@ -0,0 +1,18 @@
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
class WebDriver(RemoteWebDriver):
port: Any
edge_service: Any
def __init__(
self,
executable_path: str = ...,
capabilities: Any | None = ...,
port: int = ...,
verbose: bool = ...,
service_log_path: Any | None = ...,
log_path: Any | None = ...,
keep_alive: bool = ...,
) -> None: ...
def quit(self) -> None: ...

View File

@@ -0,0 +1,20 @@
from typing import Any
from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection
LOGGER: Any
PORT: int
HOST: Any
class ExtensionConnection(RemoteConnection):
profile: Any
binary: Any
def __init__(self, host, firefox_profile, firefox_binary: Any | None = ..., timeout: int = ...) -> None: ...
def quit(self, sessionId: Any | None = ...) -> None: ...
def connect(self): ...
@classmethod
def connect_and_quit(cls) -> None: ...
@classmethod
def is_connectable(cls) -> None: ...
class ExtensionConnectionError(Exception): ...

View File

@@ -0,0 +1,11 @@
from typing import Any
class FirefoxBinary:
NO_FOCUS_LIBRARY_NAME: str
command_line: Any
def __init__(self, firefox_path: Any | None = ..., log_file: Any | None = ...) -> None: ...
def add_command_line_options(self, *args) -> None: ...
profile: Any
def launch_browser(self, profile, timeout: int = ...) -> None: ...
def kill(self) -> None: ...
def which(self, fname): ...

View File

@@ -0,0 +1,41 @@
from typing import Any
WEBDRIVER_EXT: str
WEBDRIVER_PREFERENCES: str
EXTENSION_NAME: str
class AddonFormatError(Exception): ...
class FirefoxProfile:
ANONYMOUS_PROFILE_NAME: str
DEFAULT_PREFERENCES: Any
default_preferences: Any
profile_dir: Any
tempfolder: Any
extensionsDir: Any
userPrefs: Any
def __init__(self, profile_directory: Any | None = ...) -> None: ...
def set_preference(self, key, value) -> None: ...
def add_extension(self, extension=...) -> None: ...
def update_preferences(self) -> None: ...
@property
def path(self): ...
@property
def port(self): ...
@port.setter
def port(self, port) -> None: ...
@property
def accept_untrusted_certs(self): ...
@accept_untrusted_certs.setter
def accept_untrusted_certs(self, value) -> None: ...
@property
def assume_untrusted_cert_issuer(self): ...
@assume_untrusted_cert_issuer.setter
def assume_untrusted_cert_issuer(self, value) -> None: ...
@property
def native_events_enabled(self): ...
@native_events_enabled.setter
def native_events_enabled(self, value) -> None: ...
@property
def encoded(self): ...
def set_proxy(self, proxy) -> None: ...

View File

@@ -0,0 +1,46 @@
from typing import Any
class Log:
level: Any
def __init__(self) -> None: ...
def to_capabilities(self): ...
class Options:
KEY: str
log: Any
def __init__(self) -> None: ...
@property
def binary(self): ...
@binary.setter
def binary(self, new_binary) -> None: ...
@property
def binary_location(self): ...
@binary_location.setter
def binary_location(self, value) -> None: ...
@property
def accept_insecure_certs(self): ...
@accept_insecure_certs.setter
def accept_insecure_certs(self, value) -> None: ...
@property
def capabilities(self): ...
def set_capability(self, name, value) -> None: ...
@property
def preferences(self): ...
def set_preference(self, name, value) -> None: ...
@property
def proxy(self): ...
@proxy.setter
def proxy(self, value) -> None: ...
@property
def profile(self): ...
@profile.setter
def profile(self, new_profile) -> None: ...
@property
def arguments(self): ...
def add_argument(self, argument) -> None: ...
@property
def headless(self): ...
@headless.setter
def headless(self, value) -> None: ...
def set_headless(self, headless: bool = ...) -> None: ...
def to_capabilities(self): ...

View File

@@ -0,0 +1,4 @@
from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection
class FirefoxRemoteConnection(RemoteConnection):
def __init__(self, remote_server_addr, keep_alive: bool = ...) -> None: ...

View File

@@ -0,0 +1,11 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
service_args: Any
def __init__(
self, executable_path, port: int = ..., service_args: Any | None = ..., log_path: str = ..., env: Any | None = ...
) -> None: ...
def command_line_args(self): ...
def send_remote_shutdown_command(self) -> None: ...

View File

@@ -0,0 +1,45 @@
from collections.abc import Generator
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .extension_connection import ExtensionConnection as ExtensionConnection
from .firefox_binary import FirefoxBinary as FirefoxBinary
from .firefox_profile import FirefoxProfile as FirefoxProfile
from .options import Options as Options
from .remote_connection import FirefoxRemoteConnection as FirefoxRemoteConnection
from .service import Service as Service
from .webelement import FirefoxWebElement as FirefoxWebElement
basestring = str
class WebDriver(RemoteWebDriver):
NATIVE_EVENTS_ALLOWED: Any
CONTEXT_CHROME: str
CONTEXT_CONTENT: str
binary: Any
profile: Any
service: Any
def __init__(
self,
firefox_profile: Any | None = ...,
firefox_binary: Any | None = ...,
timeout: int = ...,
capabilities: Any | None = ...,
proxy: Any | None = ...,
executable_path: str = ...,
options: Any | None = ...,
service_log_path: str = ...,
firefox_options: Any | None = ...,
service_args: Any | None = ...,
desired_capabilities: Any | None = ...,
log_path: Any | None = ...,
keep_alive: bool = ...,
) -> None: ...
def quit(self) -> None: ...
@property
def firefox_profile(self): ...
def set_context(self, context) -> None: ...
def context(self, context) -> Generator[None, None, None]: ...
def install_addon(self, path, temporary: Any | None = ...): ...
def uninstall_addon(self, identifier) -> None: ...

View File

@@ -0,0 +1,6 @@
from selenium.webdriver.remote.webelement import WebElement as RemoteWebElement
class FirefoxWebElement(RemoteWebElement):
@property
def anonymous_children(self): ...
def find_anonymous_element_by_attribute(self, name, value): ...

View File

@@ -0,0 +1,95 @@
class ElementScrollBehavior:
TOP: int
BOTTOM: int
class Options:
KEY: str
SWITCHES: str
BROWSER_ATTACH_TIMEOUT: str
ELEMENT_SCROLL_BEHAVIOR: str
ENSURE_CLEAN_SESSION: str
FILE_UPLOAD_DIALOG_TIMEOUT: str
FORCE_CREATE_PROCESS_API: str
FORCE_SHELL_WINDOWS_API: str
FULL_PAGE_SCREENSHOT: str
IGNORE_PROTECTED_MODE_SETTINGS: str
IGNORE_ZOOM_LEVEL: str
INITIAL_BROWSER_URL: str
NATIVE_EVENTS: str
PERSISTENT_HOVER: str
REQUIRE_WINDOW_FOCUS: str
USE_PER_PROCESS_PROXY: str
VALIDATE_COOKIE_DOCUMENT_TYPE: str
def __init__(self) -> None: ...
@property
def arguments(self): ...
def add_argument(self, argument) -> None: ...
@property
def options(self): ...
@property
def capabilities(self): ...
def set_capability(self, name, value) -> None: ...
@property
def browser_attach_timeout(self): ...
@browser_attach_timeout.setter
def browser_attach_timeout(self, value) -> None: ...
@property
def element_scroll_behavior(self): ...
@element_scroll_behavior.setter
def element_scroll_behavior(self, value) -> None: ...
@property
def ensure_clean_session(self): ...
@ensure_clean_session.setter
def ensure_clean_session(self, value) -> None: ...
@property
def file_upload_dialog_timeout(self): ...
@file_upload_dialog_timeout.setter
def file_upload_dialog_timeout(self, value) -> None: ...
@property
def force_create_process_api(self): ...
@force_create_process_api.setter
def force_create_process_api(self, value) -> None: ...
@property
def force_shell_windows_api(self): ...
@force_shell_windows_api.setter
def force_shell_windows_api(self, value) -> None: ...
@property
def full_page_screenshot(self): ...
@full_page_screenshot.setter
def full_page_screenshot(self, value) -> None: ...
@property
def ignore_protected_mode_settings(self): ...
@ignore_protected_mode_settings.setter
def ignore_protected_mode_settings(self, value) -> None: ...
@property
def ignore_zoom_level(self): ...
@ignore_zoom_level.setter
def ignore_zoom_level(self, value) -> None: ...
@property
def initial_browser_url(self): ...
@initial_browser_url.setter
def initial_browser_url(self, value) -> None: ...
@property
def native_events(self): ...
@native_events.setter
def native_events(self, value) -> None: ...
@property
def persistent_hover(self): ...
@persistent_hover.setter
def persistent_hover(self, value) -> None: ...
@property
def require_window_focus(self): ...
@require_window_focus.setter
def require_window_focus(self, value) -> None: ...
@property
def use_per_process_proxy(self): ...
@use_per_process_proxy.setter
def use_per_process_proxy(self, value) -> None: ...
@property
def validate_cookie_document_type(self): ...
@validate_cookie_document_type.setter
def validate_cookie_document_type(self, value) -> None: ...
@property
def additional_options(self): ...
def add_additional_option(self, name, value) -> None: ...
def to_capabilities(self): ...

View File

@@ -0,0 +1,10 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
service_args: Any
def __init__(
self, executable_path, port: int = ..., host: Any | None = ..., log_level: Any | None = ..., log_file: Any | None = ...
) -> None: ...
def command_line_args(self): ...

View File

@@ -0,0 +1,34 @@
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .options import Options as Options
from .service import Service as Service
DEFAULT_TIMEOUT: int
DEFAULT_PORT: int
DEFAULT_HOST: Any
DEFAULT_LOG_LEVEL: Any
DEFAULT_SERVICE_LOG_PATH: Any
class WebDriver(RemoteWebDriver):
port: Any
host: Any
iedriver: Any
def __init__(
self,
executable_path: str = ...,
capabilities: Any | None = ...,
port=...,
timeout=...,
host=...,
log_level=...,
service_log_path=...,
options: Any | None = ...,
ie_options: Any | None = ...,
desired_capabilities: Any | None = ...,
log_file: Any | None = ...,
keep_alive: bool = ...,
) -> None: ...
def quit(self) -> None: ...
def create_options(self): ...

View File

@@ -0,0 +1,25 @@
from selenium.webdriver.chrome.options import Options as ChromeOptions
class Options(ChromeOptions):
KEY: str
def __init__(self) -> None: ...
@property
def capabilities(self): ...
def set_capability(self, name, value) -> None: ...
@property
def android_package_name(self): ...
@android_package_name.setter
def android_package_name(self, value) -> None: ...
@property
def android_device_socket(self): ...
@android_device_socket.setter
def android_device_socket(self, value) -> None: ...
@property
def android_command_line_file(self): ...
@android_command_line_file.setter
def android_command_line_file(self, value) -> None: ...
def to_capabilities(self): ...
class AndroidOptions(Options):
android_package_name: str
def __init__(self) -> None: ...

View File

@@ -0,0 +1,32 @@
from typing import Any
from selenium.webdriver.chrome.webdriver import WebDriver as ChromiumDriver
from .options import Options as Options
class OperaDriver(ChromiumDriver):
def __init__(
self,
executable_path: Any | None = ...,
port: int = ...,
options: Any | None = ...,
service_args: Any | None = ...,
desired_capabilities: Any | None = ...,
service_log_path: Any | None = ...,
opera_options: Any | None = ...,
keep_alive: bool = ...,
) -> None: ...
def create_options(self): ...
class WebDriver(OperaDriver):
class ServiceType:
CHROMIUM: int
def __init__(
self,
desired_capabilities: Any | None = ...,
executable_path: Any | None = ...,
port: int = ...,
service_log_path: Any | None = ...,
service_args: Any | None = ...,
options: Any | None = ...,
) -> None: ...

View File

@@ -0,0 +1,11 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
service_args: Any
def __init__(self, executable_path, port: int = ..., service_args: Any | None = ..., log_path: Any | None = ...) -> None: ...
def command_line_args(self): ...
@property
def service_url(self): ...
def send_remote_shutdown_command(self) -> None: ...

View File

@@ -0,0 +1,17 @@
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .service import Service as Service
class WebDriver(RemoteWebDriver):
service: Any
def __init__(
self,
executable_path: str = ...,
port: int = ...,
desired_capabilities=...,
service_args: Any | None = ...,
service_log_path: Any | None = ...,
) -> None: ...
def quit(self) -> None: ...

View File

@@ -0,0 +1,126 @@
class Command:
STATUS: str
NEW_SESSION: str
GET_ALL_SESSIONS: str
DELETE_SESSION: str
CLOSE: str
QUIT: str
GET: str
GO_BACK: str
GO_FORWARD: str
REFRESH: str
ADD_COOKIE: str
GET_COOKIE: str
GET_ALL_COOKIES: str
DELETE_COOKIE: str
DELETE_ALL_COOKIES: str
FIND_ELEMENT: str
FIND_ELEMENTS: str
FIND_CHILD_ELEMENT: str
FIND_CHILD_ELEMENTS: str
CLEAR_ELEMENT: str
CLICK_ELEMENT: str
SEND_KEYS_TO_ELEMENT: str
SEND_KEYS_TO_ACTIVE_ELEMENT: str
SUBMIT_ELEMENT: str
UPLOAD_FILE: str
GET_CURRENT_WINDOW_HANDLE: str
W3C_GET_CURRENT_WINDOW_HANDLE: str
GET_WINDOW_HANDLES: str
W3C_GET_WINDOW_HANDLES: str
GET_WINDOW_SIZE: str
W3C_GET_WINDOW_SIZE: str
W3C_GET_WINDOW_POSITION: str
GET_WINDOW_POSITION: str
SET_WINDOW_SIZE: str
W3C_SET_WINDOW_SIZE: str
SET_WINDOW_RECT: str
GET_WINDOW_RECT: str
SET_WINDOW_POSITION: str
W3C_SET_WINDOW_POSITION: str
SWITCH_TO_WINDOW: str
SWITCH_TO_FRAME: str
SWITCH_TO_PARENT_FRAME: str
GET_ACTIVE_ELEMENT: str
W3C_GET_ACTIVE_ELEMENT: str
GET_CURRENT_URL: str
GET_PAGE_SOURCE: str
GET_TITLE: str
EXECUTE_SCRIPT: str
W3C_EXECUTE_SCRIPT: str
W3C_EXECUTE_SCRIPT_ASYNC: str
GET_ELEMENT_TEXT: str
GET_ELEMENT_VALUE: str
GET_ELEMENT_TAG_NAME: str
SET_ELEMENT_SELECTED: str
IS_ELEMENT_SELECTED: str
IS_ELEMENT_ENABLED: str
IS_ELEMENT_DISPLAYED: str
GET_ELEMENT_LOCATION: str
GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW: str
GET_ELEMENT_SIZE: str
GET_ELEMENT_RECT: str
GET_ELEMENT_ATTRIBUTE: str
GET_ELEMENT_PROPERTY: str
GET_ELEMENT_VALUE_OF_CSS_PROPERTY: str
SCREENSHOT: str
ELEMENT_SCREENSHOT: str
IMPLICIT_WAIT: str
EXECUTE_ASYNC_SCRIPT: str
SET_SCRIPT_TIMEOUT: str
SET_TIMEOUTS: str
MAXIMIZE_WINDOW: str
W3C_MAXIMIZE_WINDOW: str
GET_LOG: str
GET_AVAILABLE_LOG_TYPES: str
FULLSCREEN_WINDOW: str
MINIMIZE_WINDOW: str
DISMISS_ALERT: str
W3C_DISMISS_ALERT: str
ACCEPT_ALERT: str
W3C_ACCEPT_ALERT: str
SET_ALERT_VALUE: str
W3C_SET_ALERT_VALUE: str
GET_ALERT_TEXT: str
W3C_GET_ALERT_TEXT: str
SET_ALERT_CREDENTIALS: str
W3C_ACTIONS: str
W3C_CLEAR_ACTIONS: str
CLICK: str
DOUBLE_CLICK: str
MOUSE_DOWN: str
MOUSE_UP: str
MOVE_TO: str
SET_SCREEN_ORIENTATION: str
GET_SCREEN_ORIENTATION: str
SINGLE_TAP: str
TOUCH_DOWN: str
TOUCH_UP: str
TOUCH_MOVE: str
TOUCH_SCROLL: str
DOUBLE_TAP: str
LONG_PRESS: str
FLICK: str
EXECUTE_SQL: str
GET_LOCATION: str
SET_LOCATION: str
GET_APP_CACHE: str
GET_APP_CACHE_STATUS: str
CLEAR_APP_CACHE: str
GET_LOCAL_STORAGE_ITEM: str
REMOVE_LOCAL_STORAGE_ITEM: str
GET_LOCAL_STORAGE_KEYS: str
SET_LOCAL_STORAGE_ITEM: str
CLEAR_LOCAL_STORAGE: str
GET_LOCAL_STORAGE_SIZE: str
GET_SESSION_STORAGE_ITEM: str
REMOVE_SESSION_STORAGE_ITEM: str
GET_SESSION_STORAGE_KEYS: str
SET_SESSION_STORAGE_ITEM: str
CLEAR_SESSION_STORAGE: str
GET_SESSION_STORAGE_SIZE: str
GET_NETWORK_CONNECTION: str
SET_NETWORK_CONNECTION: str
CURRENT_CONTEXT_HANDLE: str
CONTEXT_HANDLES: str
SWITCH_TO_CONTEXT: str

View File

@@ -0,0 +1,74 @@
from typing import Any
from selenium.common.exceptions import (
ElementClickInterceptedException as ElementClickInterceptedException,
ElementNotInteractableException as ElementNotInteractableException,
ElementNotSelectableException as ElementNotSelectableException,
ElementNotVisibleException as ElementNotVisibleException,
ErrorInResponseException as ErrorInResponseException,
ImeActivationFailedException as ImeActivationFailedException,
ImeNotAvailableException as ImeNotAvailableException,
InsecureCertificateException as InsecureCertificateException,
InvalidArgumentException as InvalidArgumentException,
InvalidCookieDomainException as InvalidCookieDomainException,
InvalidCoordinatesException as InvalidCoordinatesException,
InvalidElementStateException as InvalidElementStateException,
InvalidSelectorException as InvalidSelectorException,
InvalidSessionIdException as InvalidSessionIdException,
JavascriptException as JavascriptException,
MoveTargetOutOfBoundsException as MoveTargetOutOfBoundsException,
NoAlertPresentException as NoAlertPresentException,
NoSuchCookieException as NoSuchCookieException,
NoSuchElementException as NoSuchElementException,
NoSuchFrameException as NoSuchFrameException,
NoSuchWindowException as NoSuchWindowException,
ScreenshotException as ScreenshotException,
SessionNotCreatedException as SessionNotCreatedException,
StaleElementReferenceException as StaleElementReferenceException,
TimeoutException as TimeoutException,
UnableToSetCookieException as UnableToSetCookieException,
UnexpectedAlertPresentException as UnexpectedAlertPresentException,
UnknownMethodException as UnknownMethodException,
WebDriverException as WebDriverException,
)
class ErrorCode:
SUCCESS: int
NO_SUCH_ELEMENT: Any
NO_SUCH_FRAME: Any
UNKNOWN_COMMAND: Any
STALE_ELEMENT_REFERENCE: Any
ELEMENT_NOT_VISIBLE: Any
INVALID_ELEMENT_STATE: Any
UNKNOWN_ERROR: Any
ELEMENT_IS_NOT_SELECTABLE: Any
JAVASCRIPT_ERROR: Any
XPATH_LOOKUP_ERROR: Any
TIMEOUT: Any
NO_SUCH_WINDOW: Any
INVALID_COOKIE_DOMAIN: Any
UNABLE_TO_SET_COOKIE: Any
UNEXPECTED_ALERT_OPEN: Any
NO_ALERT_OPEN: Any
SCRIPT_TIMEOUT: Any
INVALID_ELEMENT_COORDINATES: Any
IME_NOT_AVAILABLE: Any
IME_ENGINE_ACTIVATION_FAILED: Any
INVALID_SELECTOR: Any
SESSION_NOT_CREATED: Any
MOVE_TARGET_OUT_OF_BOUNDS: Any
INVALID_XPATH_SELECTOR: Any
INVALID_XPATH_SELECTOR_RETURN_TYPER: Any
ELEMENT_NOT_INTERACTABLE: Any
INSECURE_CERTIFICATE: Any
INVALID_ARGUMENT: Any
INVALID_COORDINATES: Any
INVALID_SESSION_ID: Any
NO_SUCH_COOKIE: Any
UNABLE_TO_CAPTURE_SCREEN: Any
ELEMENT_CLICK_INTERCEPTED: Any
UNKNOWN_METHOD: Any
METHOD_NOT_ALLOWED: Any
class ErrorHandler:
def check_response(self, response) -> None: ...

View File

@@ -0,0 +1,13 @@
import abc
from typing import Any
class FileDetector(metaclass=abc.ABCMeta):
__metaclass__: Any
@abc.abstractmethod
def is_local_file(self, *keys): ...
class UselessFileDetector(FileDetector):
def is_local_file(self, *keys) -> None: ...
class LocalFileDetector(FileDetector):
def is_local_file(self, *keys): ...

View File

@@ -0,0 +1,28 @@
from typing import Any
from .command import Command as Command
class Mobile:
class ConnectionType:
mask: Any
def __init__(self, mask) -> None: ...
@property
def airplane_mode(self): ...
@property
def wifi(self): ...
@property
def data(self): ...
ALL_NETWORK: Any
WIFI_NETWORK: Any
DATA_NETWORK: Any
AIRPLANE_MODE: Any
def __init__(self, driver) -> None: ...
@property
def network_connection(self): ...
def set_network_connection(self, network): ...
@property
def context(self): ...
@context.setter
def context(self, new_context) -> None: ...
@property
def contexts(self): ...

View File

@@ -0,0 +1,19 @@
from typing import Any
from .command import Command as Command
from .errorhandler import ErrorCode as ErrorCode
LOGGER: Any
class RemoteConnection:
@classmethod
def get_timeout(cls): ...
@classmethod
def set_timeout(cls, timeout) -> None: ...
@classmethod
def reset_timeout(cls) -> None: ...
@classmethod
def get_remote_connection_headers(cls, parsed_url, keep_alive: bool = ...): ...
keep_alive: Any
def __init__(self, remote_server_addr, keep_alive: bool = ..., resolve_ip: bool = ...) -> None: ...
def execute(self, command, params): ...

View File

@@ -0,0 +1,22 @@
from selenium.common.exceptions import (
NoSuchElementException as NoSuchElementException,
NoSuchFrameException as NoSuchFrameException,
NoSuchWindowException as NoSuchWindowException,
)
from selenium.webdriver.common.alert import Alert as Alert
from selenium.webdriver.common.by import By as By
from .command import Command as Command
basestring = str
class SwitchTo:
def __init__(self, driver) -> None: ...
@property
def active_element(self): ...
@property
def alert(self): ...
def default_content(self) -> None: ...
def frame(self, frame_reference) -> None: ...
def parent_frame(self) -> None: ...
def window(self, window_name) -> None: ...

View File

@@ -0,0 +1,8 @@
from typing import Any
LOGGER: Any
def format_json(json_struct): ...
def dump_json(json_struct): ...
def load_json(s): ...
def unzip_to_temp_dir(zip_file_name): ...

View File

@@ -0,0 +1,126 @@
from collections.abc import Generator
from typing import Any
from selenium.common.exceptions import (
InvalidArgumentException as InvalidArgumentException,
NoSuchCookieException as NoSuchCookieException,
WebDriverException as WebDriverException,
)
from selenium.webdriver.common.by import By as By
from selenium.webdriver.common.html5.application_cache import ApplicationCache as ApplicationCache
from .command import Command as Command
from .errorhandler import ErrorHandler as ErrorHandler
from .file_detector import FileDetector as FileDetector, LocalFileDetector as LocalFileDetector
from .mobile import Mobile as Mobile
from .remote_connection import RemoteConnection as RemoteConnection
from .switch_to import SwitchTo as SwitchTo
from .webelement import WebElement as WebElement
class WebDriver:
command_executor: Any
session_id: Any
capabilities: Any
error_handler: Any
def __init__(
self,
command_executor: str = ...,
desired_capabilities: Any | None = ...,
browser_profile: Any | None = ...,
proxy: Any | None = ...,
keep_alive: bool = ...,
file_detector: Any | None = ...,
options: Any | None = ...,
) -> None: ...
def __enter__(self): ...
def __exit__(self, *args) -> None: ...
def file_detector_context(self, file_detector_class, *args, **kwargs) -> Generator[None, None, None]: ...
@property
def mobile(self): ...
@property
def name(self): ...
def start_client(self) -> None: ...
def stop_client(self) -> None: ...
w3c: Any
def start_session(self, capabilities, browser_profile: Any | None = ...) -> None: ...
def create_web_element(self, element_id): ...
def execute(self, driver_command, params: Any | None = ...): ...
def get(self, url) -> None: ...
@property
def title(self): ...
def find_element_by_id(self, id_): ...
def find_elements_by_id(self, id_): ...
def find_element_by_xpath(self, xpath): ...
def find_elements_by_xpath(self, xpath): ...
def find_element_by_link_text(self, link_text): ...
def find_elements_by_link_text(self, text): ...
def find_element_by_partial_link_text(self, link_text): ...
def find_elements_by_partial_link_text(self, link_text): ...
def find_element_by_name(self, name): ...
def find_elements_by_name(self, name): ...
def find_element_by_tag_name(self, name): ...
def find_elements_by_tag_name(self, name): ...
def find_element_by_class_name(self, name): ...
def find_elements_by_class_name(self, name): ...
def find_element_by_css_selector(self, css_selector): ...
def find_elements_by_css_selector(self, css_selector): ...
def execute_script(self, script, *args): ...
def execute_async_script(self, script, *args): ...
@property
def current_url(self): ...
@property
def page_source(self): ...
def close(self) -> None: ...
def quit(self) -> None: ...
@property
def current_window_handle(self): ...
@property
def window_handles(self): ...
def maximize_window(self) -> None: ...
def fullscreen_window(self) -> None: ...
def minimize_window(self) -> None: ...
@property
def switch_to(self): ...
def switch_to_active_element(self): ...
def switch_to_window(self, window_name) -> None: ...
def switch_to_frame(self, frame_reference) -> None: ...
def switch_to_default_content(self) -> None: ...
def switch_to_alert(self): ...
def back(self) -> None: ...
def forward(self) -> None: ...
def refresh(self) -> None: ...
def get_cookies(self): ...
def get_cookie(self, name): ...
def delete_cookie(self, name) -> None: ...
def delete_all_cookies(self) -> None: ...
def add_cookie(self, cookie_dict) -> None: ...
def implicitly_wait(self, time_to_wait) -> None: ...
def set_script_timeout(self, time_to_wait) -> None: ...
def set_page_load_timeout(self, time_to_wait) -> None: ...
def find_element(self, by=..., value: Any | None = ...): ...
def find_elements(self, by=..., value: Any | None = ...): ...
@property
def desired_capabilities(self): ...
def get_screenshot_as_file(self, filename): ...
def save_screenshot(self, filename): ...
def get_screenshot_as_png(self): ...
def get_screenshot_as_base64(self): ...
def set_window_size(self, width, height, windowHandle: str = ...) -> None: ...
def get_window_size(self, windowHandle: str = ...): ...
def set_window_position(self, x, y, windowHandle: str = ...): ...
def get_window_position(self, windowHandle: str = ...): ...
def get_window_rect(self): ...
def set_window_rect(self, x: Any | None = ..., y: Any | None = ..., width: Any | None = ..., height: Any | None = ...): ...
@property
def file_detector(self): ...
@file_detector.setter
def file_detector(self, detector) -> None: ...
@property
def orientation(self): ...
@orientation.setter
def orientation(self, value) -> None: ...
@property
def application_cache(self): ...
@property
def log_types(self): ...
def get_log(self, log_type): ...

View File

@@ -0,0 +1,64 @@
from typing import Any
from selenium.common.exceptions import WebDriverException as WebDriverException
from selenium.webdriver.common.by import By as By
from .command import Command as Command
getAttribute_js: Any
isDisplayed_js: Any
class WebElement:
def __init__(self, parent, id_, w3c: bool = ...) -> None: ...
@property
def tag_name(self): ...
@property
def text(self): ...
def click(self) -> None: ...
def submit(self) -> None: ...
def clear(self) -> None: ...
def get_property(self, name): ...
def get_attribute(self, name): ...
def is_selected(self): ...
def is_enabled(self): ...
def find_element_by_id(self, id_): ...
def find_elements_by_id(self, id_): ...
def find_element_by_name(self, name): ...
def find_elements_by_name(self, name): ...
def find_element_by_link_text(self, link_text): ...
def find_elements_by_link_text(self, link_text): ...
def find_element_by_partial_link_text(self, link_text): ...
def find_elements_by_partial_link_text(self, link_text): ...
def find_element_by_tag_name(self, name): ...
def find_elements_by_tag_name(self, name): ...
def find_element_by_xpath(self, xpath): ...
def find_elements_by_xpath(self, xpath): ...
def find_element_by_class_name(self, name): ...
def find_elements_by_class_name(self, name): ...
def find_element_by_css_selector(self, css_selector): ...
def find_elements_by_css_selector(self, css_selector): ...
def send_keys(self, *value) -> None: ...
def is_displayed(self): ...
@property
def location_once_scrolled_into_view(self): ...
@property
def size(self): ...
def value_of_css_property(self, property_name): ...
@property
def location(self): ...
@property
def rect(self): ...
@property
def screenshot_as_base64(self): ...
@property
def screenshot_as_png(self): ...
def screenshot(self, filename): ...
@property
def parent(self): ...
@property
def id(self): ...
def __eq__(self, element): ...
def __ne__(self, element): ...
def find_element(self, by=..., value: Any | None = ...): ...
def find_elements(self, by=..., value: Any | None = ...): ...
def __hash__(self): ...

View File

@@ -0,0 +1,2 @@
class Permission:
GET_USER_MEDIA: str

View File

@@ -0,0 +1,4 @@
from selenium.webdriver.remote.remote_connection import RemoteConnection as RemoteConnection
class SafariRemoteConnection(RemoteConnection):
def __init__(self, remote_server_addr, keep_alive: bool = ...) -> None: ...

View File

@@ -0,0 +1,11 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
service_args: Any
quiet: Any
def __init__(self, executable_path, port: int = ..., quiet: bool = ..., service_args: Any | None = ...) -> None: ...
def command_line_args(self): ...
@property
def service_url(self): ...

View File

@@ -0,0 +1,25 @@
from typing import Any
from selenium.common.exceptions import WebDriverException as WebDriverException
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities as DesiredCapabilities
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .remote_connection import SafariRemoteConnection as SafariRemoteConnection
from .service import Service as Service
class WebDriver(RemoteWebDriver):
service: Any
def __init__(
self,
port: int = ...,
executable_path: str = ...,
reuse_service: bool = ...,
desired_capabilities=...,
quiet: bool = ...,
keep_alive: bool = ...,
service_args: Any | None = ...,
) -> None: ...
def quit(self) -> None: ...
def set_permission(self, permission, value) -> None: ...
def get_permission(self, permission): ...
def debug(self) -> None: ...

View File

@@ -0,0 +1,20 @@
class AbstractEventListener:
def before_navigate_to(self, url, driver) -> None: ...
def after_navigate_to(self, url, driver) -> None: ...
def before_navigate_back(self, driver) -> None: ...
def after_navigate_back(self, driver) -> None: ...
def before_navigate_forward(self, driver) -> None: ...
def after_navigate_forward(self, driver) -> None: ...
def before_find(self, by, value, driver) -> None: ...
def after_find(self, by, value, driver) -> None: ...
def before_click(self, element, driver) -> None: ...
def after_click(self, element, driver) -> None: ...
def before_change_value_of(self, element, driver) -> None: ...
def after_change_value_of(self, element, driver) -> None: ...
def before_execute_script(self, script, driver) -> None: ...
def after_execute_script(self, script, driver) -> None: ...
def before_close(self, driver) -> None: ...
def after_close(self, driver) -> None: ...
def before_quit(self, driver) -> None: ...
def after_quit(self, driver) -> None: ...
def on_exception(self, exception, driver) -> None: ...

View File

@@ -0,0 +1,31 @@
from typing import Any
RGB_PATTERN: str
RGB_PCT_PATTERN: str
RGBA_PATTERN: str
RGBA_PCT_PATTERN: str
HEX_PATTERN: str
HEX3_PATTERN: str
HSL_PATTERN: str
HSLA_PATTERN: str
class Color:
match_obj: Any
@staticmethod
def from_string(str_): ...
red: Any
green: Any
blue: Any
alpha: Any
def __init__(self, red, green, blue, alpha: int = ...) -> None: ...
@property
def rgb(self): ...
@property
def rgba(self): ...
@property
def hex(self): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __hash__(self): ...
Colors: Any

View File

@@ -0,0 +1,68 @@
from typing import Any
from selenium.common.exceptions import WebDriverException as WebDriverException
from selenium.webdriver.common.by import By as By
from selenium.webdriver.remote.webdriver import WebDriver as WebDriver
from selenium.webdriver.remote.webelement import WebElement as WebElement
from .abstract_event_listener import AbstractEventListener as AbstractEventListener
class EventFiringWebDriver:
def __init__(self, driver, event_listener) -> None: ...
@property
def wrapped_driver(self): ...
def get(self, url) -> None: ...
def back(self) -> None: ...
def forward(self) -> None: ...
def execute_script(self, script, *args): ...
def execute_async_script(self, script, *args): ...
def close(self) -> None: ...
def quit(self) -> None: ...
def find_element(self, by=..., value: Any | None = ...): ...
def find_elements(self, by=..., value: Any | None = ...): ...
def find_element_by_id(self, id_): ...
def find_elements_by_id(self, id_): ...
def find_element_by_xpath(self, xpath): ...
def find_elements_by_xpath(self, xpath): ...
def find_element_by_link_text(self, link_text): ...
def find_elements_by_link_text(self, text): ...
def find_element_by_partial_link_text(self, link_text): ...
def find_elements_by_partial_link_text(self, link_text): ...
def find_element_by_name(self, name): ...
def find_elements_by_name(self, name): ...
def find_element_by_tag_name(self, name): ...
def find_elements_by_tag_name(self, name): ...
def find_element_by_class_name(self, name): ...
def find_elements_by_class_name(self, name): ...
def find_element_by_css_selector(self, css_selector): ...
def find_elements_by_css_selector(self, css_selector): ...
def __setattr__(self, item, value) -> None: ...
def __getattr__(self, name): ...
class EventFiringWebElement:
def __init__(self, webelement, ef_driver) -> None: ...
@property
def wrapped_element(self): ...
def click(self) -> None: ...
def clear(self) -> None: ...
def send_keys(self, *value) -> None: ...
def find_element(self, by=..., value: Any | None = ...): ...
def find_elements(self, by=..., value: Any | None = ...): ...
def find_element_by_id(self, id_): ...
def find_elements_by_id(self, id_): ...
def find_element_by_name(self, name): ...
def find_elements_by_name(self, name): ...
def find_element_by_link_text(self, link_text): ...
def find_elements_by_link_text(self, link_text): ...
def find_element_by_partial_link_text(self, link_text): ...
def find_elements_by_partial_link_text(self, link_text): ...
def find_element_by_tag_name(self, name): ...
def find_elements_by_tag_name(self, name): ...
def find_element_by_xpath(self, xpath): ...
def find_elements_by_xpath(self, xpath): ...
def find_element_by_class_name(self, name): ...
def find_elements_by_class_name(self, name): ...
def find_element_by_css_selector(self, css_selector): ...
def find_elements_by_css_selector(self, css_selector): ...
def __setattr__(self, item, value) -> None: ...
def __getattr__(self, name): ...

View File

@@ -0,0 +1,2 @@
from .abstract_event_listener import AbstractEventListener as AbstractEventListener
from .event_firing_webdriver import EventFiringWebDriver as EventFiringWebDriver

View File

@@ -0,0 +1,140 @@
from typing import Any
from selenium.common.exceptions import (
NoAlertPresentException as NoAlertPresentException,
NoSuchElementException as NoSuchElementException,
NoSuchFrameException as NoSuchFrameException,
StaleElementReferenceException as StaleElementReferenceException,
WebDriverException as WebDriverException,
)
from selenium.webdriver.remote.webdriver import WebElement as WebElement
class title_is:
title: Any
def __init__(self, title) -> None: ...
def __call__(self, driver): ...
class title_contains:
title: Any
def __init__(self, title) -> None: ...
def __call__(self, driver): ...
class presence_of_element_located:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class url_contains:
url: Any
def __init__(self, url) -> None: ...
def __call__(self, driver): ...
class url_matches:
pattern: Any
def __init__(self, pattern) -> None: ...
def __call__(self, driver): ...
class url_to_be:
url: Any
def __init__(self, url) -> None: ...
def __call__(self, driver): ...
class url_changes:
url: Any
def __init__(self, url) -> None: ...
def __call__(self, driver): ...
class visibility_of_element_located:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class visibility_of:
element: Any
def __init__(self, element) -> None: ...
def __call__(self, ignored): ...
class presence_of_all_elements_located:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class visibility_of_any_elements_located:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class visibility_of_all_elements_located:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class text_to_be_present_in_element:
locator: Any
text: Any
def __init__(self, locator, text_) -> None: ...
def __call__(self, driver): ...
class text_to_be_present_in_element_value:
locator: Any
text: Any
def __init__(self, locator, text_) -> None: ...
def __call__(self, driver): ...
class frame_to_be_available_and_switch_to_it:
frame_locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class invisibility_of_element_located:
target: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class invisibility_of_element(invisibility_of_element_located): ...
class element_to_be_clickable:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class staleness_of:
element: Any
def __init__(self, element) -> None: ...
def __call__(self, ignored): ...
class element_to_be_selected:
element: Any
def __init__(self, element) -> None: ...
def __call__(self, ignored): ...
class element_located_to_be_selected:
locator: Any
def __init__(self, locator) -> None: ...
def __call__(self, driver): ...
class element_selection_state_to_be:
element: Any
is_selected: Any
def __init__(self, element, is_selected) -> None: ...
def __call__(self, ignored): ...
class element_located_selection_state_to_be:
locator: Any
is_selected: Any
def __init__(self, locator, is_selected) -> None: ...
def __call__(self, driver): ...
class number_of_windows_to_be:
num_windows: Any
def __init__(self, num_windows) -> None: ...
def __call__(self, driver): ...
class new_window_is_opened:
current_handles: Any
def __init__(self, current_handles) -> None: ...
def __call__(self, driver): ...
class alert_is_present:
def __init__(self) -> None: ...
def __call__(self, driver): ...

View File

@@ -0,0 +1,24 @@
from typing import Any
from selenium.common.exceptions import (
NoSuchElementException as NoSuchElementException,
UnexpectedTagNameException as UnexpectedTagNameException,
)
from selenium.webdriver.common.by import By as By
class Select:
is_multiple: Any
def __init__(self, webelement) -> None: ...
@property
def options(self): ...
@property
def all_selected_options(self): ...
@property
def first_selected_option(self): ...
def select_by_value(self, value) -> None: ...
def select_by_index(self, index) -> None: ...
def select_by_visible_text(self, text) -> None: ...
def deselect_all(self) -> None: ...
def deselect_by_value(self, value) -> None: ...
def deselect_by_index(self, index) -> None: ...
def deselect_by_visible_text(self, text) -> None: ...

View File

@@ -0,0 +1,2 @@
from .select import Select as Select
from .wait import WebDriverWait as WebDriverWait

View File

@@ -0,0 +1,11 @@
from typing import Any
from selenium.common.exceptions import NoSuchElementException as NoSuchElementException, TimeoutException as TimeoutException
POLL_FREQUENCY: float
IGNORED_EXCEPTIONS: Any
class WebDriverWait:
def __init__(self, driver, timeout, poll_frequency=..., ignored_exceptions: Any | None = ...) -> None: ...
def until(self, method, message: str = ...): ...
def until_not(self, method, message: str = ...): ...

View File

@@ -0,0 +1,18 @@
class Options:
KEY: str
def __init__(self) -> None: ...
@property
def capabilities(self): ...
def set_capability(self, name, value) -> None: ...
@property
def binary_location(self): ...
@binary_location.setter
def binary_location(self, value) -> None: ...
@property
def arguments(self): ...
def add_argument(self, argument) -> None: ...
@property
def overlay_scrollbars_enabled(self): ...
@overlay_scrollbars_enabled.setter
def overlay_scrollbars_enabled(self, value) -> None: ...
def to_capabilities(self): ...

View File

@@ -0,0 +1,8 @@
from typing import Any
from selenium.webdriver.common import service as service
class Service(service.Service):
def __init__(self, executable_path, port: int = ..., log_path: Any | None = ...) -> None: ...
def command_line_args(self): ...
def send_remote_shutdown_command(self) -> None: ...

View File

@@ -0,0 +1,18 @@
from typing import Any
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .service import Service as Service
class WebDriver(RemoteWebDriver):
service: Any
def __init__(
self,
executable_path: str = ...,
port: int = ...,
options: Any | None = ...,
desired_capabilities=...,
service_log_path: Any | None = ...,
keep_alive: bool = ...,
) -> None: ...
def quit(self) -> None: ...