Skip to content

Commit 63c830c

Browse files
committed
Add option to choose the Chromium browser binary location
1 parent bcdd9da commit 63c830c

File tree

13 files changed

+221
-35
lines changed

13 files changed

+221
-35
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ pytest my_first_test.py --pdb
524524
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
525525
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
526526
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
527+
--binary-location=PATH # (Set path of the Chromium browser binary to use.)
527528
--sjw # (Skip JS Waits for readyState to be "complete" or Angular to load.)
528529
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
529530
--headless # (Run tests in headless mode. The default arg on Linux OS.)

examples/raw_parameter_script.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
sb.dashboard = False
103103
sb._dash_initialized = False
104104
sb.message_duration = None
105+
sb.binary_location = None
105106
sb.enable_3d_apis = False
106107
sb.block_images = False
107108
sb.do_not_track = False

help_docs/customizing_test_runs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ pytest my_first_test.py --settings-file=custom_settings.py
132132
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
133133
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
134134
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
135+
--binary-location=PATH # (Set path of the Chromium browser binary to use.)
135136
--sjw # (Skip JS Waits for readyState to be "complete" or Angular to load.)
136137
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
137138
--headless # (Run tests in headless mode. The default arg on Linux OS.)

seleniumbase/behave/behave_sb.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
-D firefox-pref=SET (Set a Firefox preference:value set, comma-separated.)
3939
-D extension-zip=ZIP (Load a Chrome Extension .zip|.crx, comma-separated.)
4040
-D extension-dir=DIR (Load a Chrome Extension directory, comma-separated.)
41+
-D binary-location=PATH (Set path of the Chromium browser binary to use.)
4142
-D sjw (Skip JS Waits for readyState to be "complete" or Angular to load.)
4243
-D pls=PLS (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
4344
-D headless (Run tests in headless mode. The default arg on Linux OS.)
@@ -160,6 +161,7 @@ def get_configured_sb(context):
160161
sb.device_metrics = None
161162
sb.extension_zip = None
162163
sb.extension_dir = None
164+
sb.binary_location = None
163165
sb.page_load_strategy = None
164166
sb.database_env = "test"
165167
sb.log_path = "latest_logs" + os.sep
@@ -441,6 +443,13 @@ def get_configured_sb(context):
441443
extension_dir = sb.extension_dir # revert to default
442444
sb.extension_dir = extension_dir
443445
continue
446+
# Handle: -D binary-location=PATH / binary_location=PATH
447+
if low_key in ["binary-location", "binary_location"]:
448+
binary_location = userdata[key]
449+
if binary_location == "true":
450+
binary_location = sb.binary_location # revert to default
451+
sb.binary_location = binary_location
452+
continue
444453
# Handle: -D pls=PLS / page-load-strategy=PLS / page_load_strategy=PLS
445454
if low_key in ["pls", "page-load-strategy", "page_load_strategy"]:
446455
page_load_strategy = userdata[key].lower()

0 commit comments

Comments
 (0)