CDP с удаленным веб-драйвером. Объект «WebDriver» не имеет атрибута «execute_cdp_cmd» PythonPython

Программы на Python
Anonymous
CDP с удаленным веб-драйвером. Объект «WebDriver» не имеет атрибута «execute_cdp_cmd» Python

Сообщение Anonymous »


I'm trying to run tests with CDP,

webdriver.execute_cdp_cmd('Network.enable', {}) with Remote webdriver (in Selenoid). But getting this error:

AttributeError: 'WebDriver' object has no attribute 'execute_cdp_cmd'. In local environment it works fine. I've tried to use Selenium 3.141.0 and 4.1.3.

I'm familiar with PyCDP documentation (https://py-cdp.readthedocs.io/en/latest ... arted.html) but I didn't figured out how to properly use it.

Why it does not work with Remote webdriver? Do someone have an example of executing CDP commands using python in Selenium 4?

I use following capabilities, :

capabilities = { 'loggingPrefs': {'browser': 'ALL'}, 'goog:loggingPrefs': {'performance': 'ALL'}, "browserName": "chrome", "browserVersion": "99.0", "selenoid:options": { "enableVNC": True, "enableVideo": False } }

if request.config.getoption('--remote'): driver = webdriver.Remote(command_executor='selenoid.dev:4444/wd/hub', desired_capabilities=capabilities, options=options)


Источник: https://stackoverflow.com/questions/721 ... te-cdp-cmd

Вернуться в «Python»