Selenium Driver Methods

There are 63 methods that can be used on the Selenium driver object.

To learn more about Selenium, read our Selenium with Python Tutorial.

add_cookie()Adds a cookie to your current session.
add_credential()Injects a credential into the authenticator.
add_virtual_authenticator()Adds a virtual authenticator with the given options.
back()Goes one step backward in the browser history.
bidi_connection()
close()Closes the current window.
create_options()
create_web_element()Creates a web element with the specified `element_id`.
delete_all_cookies()Delete all cookies in the scope of the session.
delete_cookie()Deletes a single cookie with the given name.
delete_network_conditions()Resets Chromium network emulation settings.
execute()Sends a command to be executed by a command.CommandExecutor.
execute_async_script()Asynchronously Executes JavaScript in the current window/frame.
execute_cdp_cmd()Execute Chrome Devtools Protocol command and get returned result The command and command args should follow chrome devtools protocol domains/commands, refer to link https://chromedevtools.github.io/devtools-protocol/
execute_script()Synchronously Executes JavaScript in the current window/frame.
file_detector_context()Overrides the current file detector (if necessary) in limited context. Ensures the original file detector is set afterwards.
find_element()Find an element given a By strategy and locator.
find_elements()Find elements given a By strategy and locator.
forward()Goes one step forward in the browser history.
fullscreen_window()Invokes the window manager-specific ‘full screen’ operation.
get()Loads a web page in the current browser session.
get_cookie()Get a single cookie by name. Returns the cookie if found, None if not.
get_cookies()Returns a set of dictionaries, corresponding to cookies visible in the current session.
get_credentials()Returns the list of credentials owned by the authenticator.
get_issue_message():Returns: An error message when there is any issue in a Cast session.
get_log()Gets the log for a given log type.
get_network_conditions()Gets Chromium network emulation settings.
get_pinned_scripts()
get_screenshot_as_base64()Gets the screenshot of the current window as a base64 encoded string which is useful in embedded images in HTML.
get_screenshot_as_file()Saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.
get_screenshot_as_png()Gets the screenshot of the current window as a binary data.
get_sinks():Returns: A list of sinks available for Cast.
get_window_position()Gets the x,y position of the current window.
get_window_rect()Gets the x, y coordinates of the window as well as height and width of the current window.
get_window_size()Gets the width and height of the current window.
implicitly_wait()Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session. To set the timeout for calls to execute_async_script, see set_script_timeout.
launch_app()Launches Chromium app specified by id.
maximize_window()Maximizes the current window that webdriver is using.
minimize_window()Invokes the window manager-specific ‘minimize’ operation.
pin_script()Store common javascript scripts to be executed later by a unique hashable ID.
print_page()Takes PDF of the current page.
quit()Closes the browser and shuts down the ChromiumDriver executable that is started when starting the ChromiumDriver.
refresh()Refreshes the current page.
remove_all_credentials()Removes all credentials from the authenticator.
remove_credential()Removes a credential from the authenticator.
remove_virtual_authenticator()Removes a previously added virtual authenticator.
save_screenshot()Saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.
set_network_conditions()Sets Chromium network emulation settings.
set_page_load_timeout()Set the amount of time to wait for a page load to complete before throwing an error.
set_permissions()Sets Applicable Permission.
set_script_timeout()Set the amount of time that the script should wait during an execute_async_script call before throwing an error.
set_sink_to_use()Sets a specific sink, using its name, as a Cast session receiver target.
set_user_verified()Sets whether the authenticator will simulate success or fail on user verification.
set_window_position()Sets the x,y position of the current window. (window.moveTo)
set_window_rect()Sets the x, y coordinates of the window as well as height and width of the current window. This method is only supported for W3C compatible browsers; other browsers should use `set_window_position` and `set_window_size`.
set_window_size()Sets the width and height of the current window. (window.resizeTo)
start_client()Called before starting a new session.
start_desktop_mirroring()Starts a desktop mirroring session on a specific receiver target.
start_session()Creates a new session with the desired capabilities.
start_tab_mirroring()Starts a tab mirroring session on a specific receiver target.
stop_casting()Stops the existing Cast session on a specific receiver target.
stop_client()Called after executing a quit command.
unpin()Remove a pinned script from storage.
Enjoyed This Post?