File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 20
20
from seleniumbase import extensions # browser extensions storage folder
21
21
urllib3 .disable_warnings ()
22
22
DRIVER_DIR = os .path .dirname (os .path .realpath (drivers .__file__ ))
23
- if DRIVER_DIR not in os .environ ["PATH" ]:
23
+ # Make sure that the SeleniumBase DRIVER_DIR is at the top of the System PATH
24
+ # (Changes to the System PATH with os.environ only last during the test run)
25
+ if not os .environ ["PATH" ].startswith (DRIVER_DIR ):
26
+ # Remove existing SeleniumBase DRIVER_DIR from System PATH if present
27
+ os .environ ["PATH" ] = os .environ ["PATH" ].replace (DRIVER_DIR , "" )
28
+ # If two path separators are next to each other, replace with just one
29
+ os .environ ["PATH" ] = os .environ ["PATH" ].replace (
30
+ os .pathsep + os .pathsep , os .pathsep )
31
+ # Put the SeleniumBase DRIVER_DIR at the beginning of the System PATH
24
32
os .environ ["PATH" ] = DRIVER_DIR + os .pathsep + os .environ ["PATH" ]
25
33
EXTENSIONS_DIR = os .path .dirname (os .path .realpath (extensions .__file__ ))
26
34
DISABLE_CSP_ZIP_PATH = "%s/%s" % (EXTENSIONS_DIR , "disable_csp.zip" )
You can’t perform that action at this time.
0 commit comments