@@ -1129,7 +1129,13 @@ def get_local_driver(
1129
1129
capabilities = firefox_capabilities , options = firefox_options
1130
1130
)
1131
1131
else :
1132
- return webdriver .Firefox (options = firefox_options )
1132
+ if os .path .exists (LOCAL_GECKODRIVER ):
1133
+ return webdriver .Firefox (
1134
+ executable_path = LOCAL_GECKODRIVER ,
1135
+ options = firefox_options ,
1136
+ )
1137
+ else :
1138
+ return webdriver .Firefox (options = firefox_options )
1133
1139
elif browser_name == constants .Browser .INTERNET_EXPLORER :
1134
1140
if not IS_WINDOWS :
1135
1141
raise Exception (
@@ -1534,7 +1540,13 @@ def get_local_driver(
1534
1540
sys .argv = sys_args # Put back original sys args
1535
1541
if not headless or "linux" not in PLATFORM :
1536
1542
try :
1537
- driver = webdriver .Chrome (options = chrome_options )
1543
+ if os .path .exists (LOCAL_CHROMEDRIVER ):
1544
+ driver = webdriver .Chrome (
1545
+ executable_path = LOCAL_CHROMEDRIVER ,
1546
+ options = chrome_options ,
1547
+ )
1548
+ else :
1549
+ driver = webdriver .Chrome (options = chrome_options )
1538
1550
except Exception as e :
1539
1551
auto_upgrade_chromedriver = False
1540
1552
if "This version of ChromeDriver only supports" in e .msg :
@@ -1599,7 +1611,13 @@ def get_local_driver(
1599
1611
chrome_options , headless_options
1600
1612
)
1601
1613
_mark_chromedriver_repaired ()
1602
- driver = webdriver .Chrome (options = chrome_options )
1614
+ if os .path .exists (LOCAL_CHROMEDRIVER ):
1615
+ driver = webdriver .Chrome (
1616
+ executable_path = LOCAL_CHROMEDRIVER ,
1617
+ options = chrome_options ,
1618
+ )
1619
+ else :
1620
+ driver = webdriver .Chrome (options = chrome_options )
1603
1621
return driver
1604
1622
else : # Running headless on Linux
1605
1623
try :
0 commit comments