I’m getting this error when I try to run my selenium test:
[9680:18428:0605/111414.227:ERROR:device_event_log_impl.cc(214)] [11:14:14.228] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
JavaScript
x
2
1
This is how my `conftest.py` file looks like:
2
Code
JavaScript
1
18
18
1
import pytest
2
from selenium import webdriver
3
from selenium.webdriver.chrome.service import Service
4
from webdriver_manager.chrome import ChromeDriverManager
5
from selenium.webdriver.common.by import By
6
from selenium.webdriver.support.wait import WebDriverWait
7
from selenium.webdriver.support import expected_conditions as EC
8
9
options = webdriver.ChromeOptions()
10
driver = webdriver.Chrome(options = options, service=Service(ChromeDriverManager().install()))
11
Facebook = "https://facebook.com"
12
wait = WebDriverWait(driver, timeout=60)
13
14
@pytest.fixture
15
def set_up():
16
driver.maximize_window()
17
driver.get(Facebook)
18
As you can see I’m trying to make tests for Facebook using Google Chrome, but for some reason I get the mentioned error, does anyone know how to fix this
Advertisement
Answer
You can Suppress this error by using below.
As per the documentation in Selenium Chrome Driver: Resolve Error Messages Regarding Registry Keys and Experimental Options these error logs can be supressed by adding the argument:
JavaScript
1
2
1
excludeSwitches: ['enable-logging']
2
So your effective code block will be:
JavaScript
1
7
1
from selenium import webdriver
2
3
options = webdriver.ChromeOptions()
4
options.add_experimental_option("excludeSwitches", ["enable-logging"])
5
driver = webdriver.Chrome(options=options, executable_path=r'C:WebDriverschromedriver.exe')
6
driver.get("https://www.google.com/")
7