Discussion:
[selenium-users] Add support for helper methods from specific browser drivers to Remote webdriver
pavel.savchenko via Selenium Users
2018-12-03 09:11:29 UTC
Permalink
Hi folks,

For example, we require access to CDP through remote driver. Currently,
we're achieve this using a subclass "hack" like so:

class CDPSupportingRemote(webdriver.Remote):
"""
Ensure driver supports `execute_cdp_cmd`

copies command from chrome to remote driver
selenium/webdriver/chrome/webdriver.py
selenium/webdriver/remote/webdriver.py
"""
execute_cdp_cmd = webdriver.Chrome.execute_cdp_cmd

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.command_executor._commands['executeCdpCommand'] = (
'POST', '/session/$sessionId/goog/cdp/execute'
)

Is this recommended? Is there a standard way to add some of the required
capabilities to a Remote driver? If not, should there be a standard way,
perhaps using mixins, or maybe some other mechanism?

Would appreciate a discussion on the subject, perhaps some comments from
core devs as to the direction we want to take in Selenium?

Best Regards,
Pavel
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/732809bf-edc7-4333-9ab2-9d6785d54eb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...