pytest-selenium icon indicating copy to clipboard operation
pytest-selenium copied to clipboard

Standard pattern for calling browser-specific functions on webdriver?

Open dhalperi opened this issue 4 years ago • 2 comments

Hi,

We make great use of the chrome_options and firefox_options fixtures - they're great.

However, some functionality is only exposed on a specific instance of Webdriver, e.g., ChromiumDriver#set_network_conditions

Is there a standard place/way to call these functions only when the right type of browser is in use? Obviously we can inspect the current webdriver, pytestconfig, test environment, etc., to determine whether it's a ChromiumDriver, but since the options are handled so nicely I thought maybe this would be too.

dhalperi avatar Jan 26 '21 18:01 dhalperi

Could you exemplify what you're looking for?

Maybe even in a PR? ;)

BeyondEvil avatar Jan 26 '21 22:01 BeyondEvil

There is a standard in flux that deals with the extra capabilities that Chrome provides via the remote DevTools Protocol. When "Webdriver Bidrectional Interface" standard is formalized, there will be a way to test this. 4.0 is in beta and I am waiting until the final release is out to understand how Firefox and Chrome report their CDP capabilities.

isaulv avatar Mar 05 '21 21:03 isaulv