Skip to content

Commit 5bdc2f5

Browse files
committed
Update comments and docstrings of SB() and Driver()
1 parent f10ca20 commit 5bdc2f5

File tree

2 files changed

+174
-172
lines changed

2 files changed

+174
-172
lines changed

seleniumbase/plugins/driver_manager.py

Lines changed: 72 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def __exit__(self, exc_type, exc_val, exc_tb):
6565

6666
def Driver(
6767
browser=None, # Choose from "chrome", "edge", "firefox", or "safari".
68-
headless=None, # The default headless mode for Chromium and Firefox.
69-
headless1=None, # Chromium's old headless mode. (Fast, but limited)
70-
headless2=None, # Chromium's new headless mode. (Has more features)
68+
headless=None, # Use the default headless mode for Chromium and Firefox.
69+
headless1=None, # Use Chromium's old headless mode. (Fast, but limited)
70+
headless2=None, # Use Chromium's new headless mode. (Has more features)
7171
headed=None, # Run tests in headed/GUI mode on Linux, where not default.
7272
locale_code=None, # Set the Language Locale Code for the web browser.
7373
protocol=None, # The Selenium Grid protocol: "http" or "https".
@@ -155,74 +155,75 @@ def Driver(
155155
156156
Optional Parameters:
157157
--------------------
158-
browser: # Choose from "chrome", "edge", "firefox", or "safari".
159-
headless: # The original headless mode for Chromium and Firefox.
160-
headless2: # Chromium's new headless mode. (Has more features)
161-
headed: # Run tests in headed/GUI mode on Linux, where not default.
162-
locale_code: # Set the Language Locale Code for the web browser.
163-
protocol: # The Selenium Grid protocol: "http" or "https".
164-
servername: # The Selenium Grid server/IP used for tests.
165-
port: # The Selenium Grid port used by the test server.
166-
proxy: # Use proxy. Format: "SERVER:PORT" or "USER:PASS@SERVER:PORT".
167-
proxy_bypass_list: # Skip proxy when using the listed domains.
168-
proxy_pac_url: # Use PAC file. (Format: URL or USERNAME:PASSWORD@URL)
169-
multi_proxy: # Allow multiple proxies with auth when multi-threaded.
170-
agent: # Modify the web browser's User-Agent string.
171-
cap_file: # The desired capabilities to use with a Selenium Grid.
172-
cap_string: # The desired capabilities to use with a Selenium Grid.
173-
recorder_ext: # Enables the SeleniumBase Recorder Chromium extension.
174-
disable_js: # Disable JavaScript on websites. Pages might break!
175-
disable_csp: # Disable the Content Security Policy of websites.
176-
enable_ws: # Enable Web Security on Chromium-based browsers.
177-
disable_ws: # Reverse of "enable_ws". (None and False are different)
178-
enable_sync: # Enable "Chrome Sync" on websites.
179-
use_auto_ext: # Use Chrome's automation extension.
180-
undetectable: # Use undetected-chromedriver to evade bot-detection.
181-
uc_cdp_events: # Capture CDP events in undetected-chromedriver mode.
182-
uc_subprocess: # Use undetected-chromedriver as a subprocess.
183-
log_cdp_events: # Capture {"performance": "ALL", "browser": "ALL"}
184-
no_sandbox: # (DEPRECATED) - "--no-sandbox" is always used now.
185-
disable_gpu: # (DEPRECATED) - GPU is disabled if not "swiftshader".
186-
incognito: # Enable Chromium's Incognito mode.
187-
guest_mode: # Enable Chromium's Guest mode.
188-
dark_mode: # Enable Chromium's Dark mode.
189-
devtools: # Open Chromium's DevTools when the browser opens.
190-
remote_debug: # Enable Chrome's Debugger on "http://localhost:9222".
191-
enable_3d_apis: # Enable WebGL and 3D APIs.
192-
swiftshader: # Chrome: --use-gl=angle / --use-angle=swiftshader-webgl
193-
ad_block_on: # Block some types of display ads from loading.
194-
host_resolver_rules: # Set host-resolver-rules, comma-separated.
195-
block_images: # Block images from loading during tests.
196-
do_not_track: # Tell websites that you don't want to be tracked.
197-
chromium_arg: # "ARG=N,ARG2" (Set Chromium args, ","-separated.)
198-
firefox_arg: # "ARG=N,ARG2" (Set Firefox args, comma-separated.)
199-
firefox_pref: # SET (Set Firefox PREFERENCE:VALUE set, ","-separated)
200-
user_data_dir: # Set the Chrome user data directory to use.
201-
extension_zip: # Load a Chrome Extension .zip|.crx, comma-separated.
202-
extension_dir: # Load a Chrome Extension directory, comma-separated.
203-
disable_features: # "F1,F2" (Disable Chrome features, ","-separated.)
204-
binary_location: # Set path of the Chromium browser binary to use.
205-
driver_version: # Set the chromedriver or uc_driver version to use.
206-
page_load_strategy: # Set Chrome PLS to "normal", "eager", or "none".
207-
use_wire: # Use selenium-wire's webdriver over selenium webdriver.
208-
external_pdf: # Set Chrome "plugins.always_open_pdf_externally":True.
209-
window_position: # Set the browser's starting window position: "X,Y"
210-
window_size: # Set the browser's starting window size: "Width,Height"
211-
is_mobile: # Use the mobile device emulator while running tests.
212-
mobile: # Shortcut / Duplicate of "is_mobile".
213-
d_width: # Set device width
214-
d_height: # Set device height
215-
d_p_r: # Set device pixel ratio
216-
uc: # Shortcut / Duplicate of "undetectable".
217-
undetected: # Shortcut / Duplicate of "undetectable".
218-
uc_cdp: # Shortcut / Duplicate of "uc_cdp_events".
219-
uc_sub: # Shortcut / Duplicate of "uc_subprocess".
220-
log_cdp: # Shortcut / Duplicate of "log_cdp_events".
221-
ad_block: # Shortcut / Duplicate of "ad_block_on".
222-
server: # Shortcut / Duplicate of "servername".
223-
guest: # Shortcut / Duplicate of "guest_mode".
224-
wire: # Shortcut / Duplicate of "use_wire".
225-
pls: # Shortcut / Duplicate of "page_load_strategy".
158+
browser (str): Choose from "chrome", "edge", "firefox", or "safari".
159+
headless (bool): Use the default headless mode for Chromium and Firefox.
160+
headless1 (bool): Use Chromium's old headless mode. (Fast, but limited)
161+
headless2 (bool): Use Chromium's new headless mode. (Has more features)
162+
headed (bool): Run tests in headed/GUI mode on Linux, where not default.
163+
locale_code (str): Set the Language Locale Code for the web browser.
164+
protocol (str): The Selenium Grid protocol: "http" or "https".
165+
servername (str): The Selenium Grid server/IP used for tests.
166+
port (int): The Selenium Grid port used by the test server.
167+
proxy (str): Use proxy. Format: "SERVER:PORT" or "USER:PASS@SERVER:PORT".
168+
proxy_bypass_list (str): Skip proxy when using the listed domains.
169+
proxy_pac_url (str): Use PAC file. (Format: URL or USERNAME:PASSWORD@URL)
170+
multi_proxy (bool): Allow multiple proxies with auth when multi-threaded.
171+
agent (str): Modify the web browser's User-Agent string.
172+
cap_file (str): The desired capabilities to use with a Selenium Grid.
173+
cap_string (str): The desired capabilities to use with a Selenium Grid.
174+
recorder_ext (bool): Enables the SeleniumBase Recorder Chromium extension.
175+
disable_js (bool): Disable JavaScript on websites. Pages might break!
176+
disable_csp (bool): Disable the Content Security Policy of websites.
177+
enable_ws (bool): Enable Web Security on Chromium-based browsers.
178+
disable_ws (bool): Reverse of "enable_ws". (None and False are different)
179+
enable_sync (bool): Enable "Chrome Sync" on websites.
180+
use_auto_ext (bool): Use Chrome's automation extension.
181+
undetectable (bool): Use undetected-chromedriver to evade bot-detection.
182+
uc_cdp_events (bool): Capture CDP events in undetected-chromedriver mode.
183+
uc_subprocess (bool): Use undetected-chromedriver as a subprocess.
184+
log_cdp_events (bool): Capture {"performance": "ALL", "browser": "ALL"}
185+
no_sandbox (bool): (DEPRECATED) - "--no-sandbox" is always used now.
186+
disable_gpu (bool): (DEPRECATED) - GPU is disabled if not "swiftshader".
187+
incognito (bool): Enable Chromium's Incognito mode.
188+
guest_mode (bool): Enable Chromium's Guest mode.
189+
dark_mode (bool): Enable Chromium's Dark mode.
190+
devtools (bool): Open Chromium's DevTools when the browser opens.
191+
remote_debug (bool): Enable Chrome's Debugger on "http://localhost:9222".
192+
enable_3d_apis (bool): Enable WebGL and 3D APIs.
193+
swiftshader (bool): Chrome: --use-gl=angle / --use-angle=swiftshader-webgl
194+
ad_block_on (bool): Block some types of display ads from loading.
195+
host_resolver_rules (str): Set host-resolver-rules, comma-separated.
196+
block_images (bool): Block images from loading during tests.
197+
do_not_track (bool): Tell websites that you don't want to be tracked.
198+
chromium_arg (str): "ARG=N,ARG2" (Set Chromium args, ","-separated.)
199+
firefox_arg (str): "ARG=N,ARG2" (Set Firefox args, comma-separated.)
200+
firefox_pref (str): SET (Set Firefox PREFERENCE:VALUE set, ","-separated)
201+
user_data_dir (str): Set the Chrome user data directory to use.
202+
extension_zip (str): Load a Chrome Extension .zip|.crx, comma-separated.
203+
extension_dir (str): Load a Chrome Extension directory, comma-separated.
204+
disable_features (str): "F1,F2" (Disable Chrome features, ","-separated.)
205+
binary_location (str): Set path of the Chromium browser binary to use.
206+
driver_version (str): Set the chromedriver or uc_driver version to use.
207+
page_load_strategy (str): Set Chrome PLS to "normal", "eager", or "none".
208+
use_wire (bool): Use selenium-wire's webdriver over selenium webdriver.
209+
external_pdf (bool): Set Chrome "plugins.always_open_pdf_externally":True
210+
window_position (x,y): Set the browser's starting window position: "X,Y"
211+
window_size (w,h): Set the browser's starting window size: "Width,Height"
212+
is_mobile (bool): Use the mobile device emulator while running tests.
213+
mobile (bool): Shortcut / Duplicate of "is_mobile".
214+
d_width (int): Set device width
215+
d_height (int): Set device height
216+
d_p_r (float): Set device pixel ratio
217+
uc (bool): Shortcut / Duplicate of "undetectable".
218+
undetected (bool): Shortcut / Duplicate of "undetectable".
219+
uc_cdp (bool): Shortcut / Duplicate of "uc_cdp_events".
220+
uc_sub (bool): Shortcut / Duplicate of "uc_subprocess".
221+
log_cdp (bool): Shortcut / Duplicate of "log_cdp_events".
222+
ad_block (bool): Shortcut / Duplicate of "ad_block_on".
223+
server (str): Shortcut / Duplicate of "servername".
224+
guest (bool): Shortcut / Duplicate of "guest_mode".
225+
wire (bool): Shortcut / Duplicate of "use_wire".
226+
pls (str): Shortcut / Duplicate of "page_load_strategy".
226227
"""
227228
from seleniumbase import config as sb_config
228229
from seleniumbase.config import settings

0 commit comments

Comments
 (0)