@@ -1430,7 +1430,10 @@ def get_local_driver(
1430
1430
else :
1431
1431
if os .path .exists (LOCAL_GECKODRIVER ):
1432
1432
if selenium4 :
1433
- service = FirefoxService (executable_path = LOCAL_GECKODRIVER )
1433
+ service = FirefoxService (
1434
+ executable_path = LOCAL_GECKODRIVER ,
1435
+ log_path = os .path .devnull ,
1436
+ )
1434
1437
try :
1435
1438
return webdriver .Firefox (
1436
1439
service = service ,
@@ -1449,10 +1452,20 @@ def get_local_driver(
1449
1452
else :
1450
1453
return webdriver .Firefox (
1451
1454
executable_path = LOCAL_GECKODRIVER ,
1455
+ service_log_path = os .path .devnull ,
1452
1456
options = firefox_options ,
1453
1457
)
1454
1458
else :
1455
- return webdriver .Firefox (options = firefox_options )
1459
+ if selenium4 :
1460
+ service = FirefoxService (log_path = os .path .devnull )
1461
+ return webdriver .Firefox (
1462
+ service = service , options = firefox_options
1463
+ )
1464
+ else :
1465
+ return webdriver .Firefox (
1466
+ service_log_path = os .path .devnull ,
1467
+ options = firefox_options ,
1468
+ )
1456
1469
elif browser_name == constants .Browser .INTERNET_EXPLORER :
1457
1470
if not IS_WINDOWS :
1458
1471
raise Exception (
@@ -1692,7 +1705,9 @@ def get_local_driver(
1692
1705
edge_options .add_argument (chromium_arg_item )
1693
1706
if selenium4 :
1694
1707
try :
1695
- service = EdgeService (executable_path = LOCAL_EDGEDRIVER )
1708
+ service = EdgeService (
1709
+ executable_path = LOCAL_EDGEDRIVER , log_path = os .path .devnull
1710
+ )
1696
1711
driver = Edge (service = service , options = edge_options )
1697
1712
except Exception as e :
1698
1713
auto_upgrade_edgedriver = False
@@ -1727,7 +1742,9 @@ def get_local_driver(
1727
1742
if not _was_chromedriver_repaired (): # Works for Edge
1728
1743
_repair_edgedriver (edge_version )
1729
1744
_mark_chromedriver_repaired () # Works for Edge
1730
- service = EdgeService (executable_path = LOCAL_EDGEDRIVER )
1745
+ service = EdgeService (
1746
+ executable_path = LOCAL_EDGEDRIVER , log_path = os .path .devnull
1747
+ )
1731
1748
driver = Edge (service = service , options = edge_options )
1732
1749
return driver
1733
1750
else :
@@ -1736,6 +1753,7 @@ def get_local_driver(
1736
1753
try :
1737
1754
driver = Edge (
1738
1755
executable_path = LOCAL_EDGEDRIVER ,
1756
+ service_log_path = os .path .devnull ,
1739
1757
capabilities = capabilities ,
1740
1758
)
1741
1759
except Exception as e :
@@ -1773,6 +1791,7 @@ def get_local_driver(
1773
1791
_mark_chromedriver_repaired () # Works for Edge
1774
1792
driver = Edge (
1775
1793
executable_path = LOCAL_EDGEDRIVER ,
1794
+ service_log_path = os .path .devnull ,
1776
1795
capabilities = capabilities ,
1777
1796
)
1778
1797
return driver
@@ -1923,7 +1942,8 @@ def get_local_driver(
1923
1942
if os .path .exists (LOCAL_CHROMEDRIVER ):
1924
1943
if selenium4 :
1925
1944
service = ChromeService (
1926
- executable_path = LOCAL_CHROMEDRIVER
1945
+ executable_path = LOCAL_CHROMEDRIVER ,
1946
+ log_path = os .path .devnull ,
1927
1947
)
1928
1948
driver = webdriver .Chrome (
1929
1949
service = service ,
@@ -1932,10 +1952,20 @@ def get_local_driver(
1932
1952
else :
1933
1953
driver = webdriver .Chrome (
1934
1954
executable_path = LOCAL_CHROMEDRIVER ,
1955
+ service_log_path = os .path .devnull ,
1935
1956
options = chrome_options ,
1936
1957
)
1937
1958
else :
1938
- driver = webdriver .Chrome (options = chrome_options )
1959
+ if selenium4 :
1960
+ service = ChromeService (log_path = os .path .devnull )
1961
+ driver = webdriver .Chrome (
1962
+ service = service , options = chrome_options
1963
+ )
1964
+ else :
1965
+ driver = webdriver .Chrome (
1966
+ options = chrome_options ,
1967
+ service_log_path = os .path .devnull ,
1968
+ )
1939
1969
except Exception as e :
1940
1970
auto_upgrade_chromedriver = False
1941
1971
if "This version of ChromeDriver only supports" in e .msg :
0 commit comments