webdriver.chrome.webdriver

Module Contents

Classes

WebDriver(self,executable_path=”chromedriver”,port=0,options=None,service_args=None,desired_capabilities=None,service_log_path=None,chrome_options=None) Controls the ChromeDriver and allows you to drive the browser.
class WebDriver(executable_path="chromedriver", port=0, options=None, service_args=None, desired_capabilities=None, service_log_path=None, chrome_options=None)

Controls the ChromeDriver and allows you to drive the browser.

You will need to download the ChromeDriver executable from http://chromedriver.storage.googleapis.com/index.html

__init__(executable_path="chromedriver", port=0, options=None, service_args=None, desired_capabilities=None, service_log_path=None, chrome_options=None)

Creates a new instance of the chrome driver.

Starts the service and then creates new instance of chrome driver.

Args:
  • executable_path - path to the executable. If the default is used it assumes the executable is in the $PATH
  • port - port you would like the service to run, if left as 0, a free port will be found.
  • desired_capabilities: Dictionary object with non-browser specific capabilities only, such as “proxy” or “loggingPref”.
  • options: this takes an instance of ChromeOptions
launch_app(id)

Launches Chrome app specified by id.

get_network_conditions()

Gets Chrome network emulation settings.

Returns:

A dict. For example:

{‘latency’: 4, ‘download_throughput’: 2, ‘upload_throughput’: 2, ‘offline’: False}

set_network_conditions(**network_conditions)

Sets Chrome network emulation settings.

Args:
  • network_conditions: A dict with conditions specification.
Usage:
driver.set_network_conditions(

offline=False, latency=5, # additional latency (ms) download_throughput=500 * 1024, # maximal throughput upload_throughput=500 * 1024) # maximal throughput

Note: ‘throughput’ can be used to set both (for download and upload).

quit()

Closes the browser and shuts down the ChromeDriver executable that is started when starting the ChromeDriver

create_options()