-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
Description
Feature and motivation
Currently there is a number of custom methods that expose Chromium commands in Chromium driver:
from selenium.webdriver import Chrome
driver = Chrome()
driver.execute_cdp_cmd('Page.enable') # <-- custom method that calls command below
driver.execute("executeCdpCommand", {"cmd": "Page.enable', "params": {}}) # <-- custom command executionThe same commands should be accessible via Remote driver as well since Grid provides the endpoints and the underlying command executor actually already supports the commands:
from selenium.webdriver.chrome.options import Options
from selenium.webdriver import Remote
driver = Remote(options=Options())
driver.execute_cdp_cmd('Page.enable') # <-- this method is not available
driver.execute("executeCdpCommand", {"cmd": "Page.enable', "params": {}}) # <-- this still works!The same approach is implemented in other bindings (Java, Ruby), where instances of Remote driver are augmented to support custom methods and commands specific to browsers.
Usage example
See above for usage example.