-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Description
Now we hide some BiDi API from users (via internal modifier) because we want to hide the complexity of its usage. Great example is network interception: this operation requires to phases: AddIntercept and Subscribe on events. So right now we provide useful API for users to guide them to do the interception properly.
From one point of view Selenium tries to help users, but from other hand the question is why Selenium hides some BiDi spec defined capabilities.
Solution
- Revisit all
internalmodifiers and make itpublic - Move all "helpers/extensions" to
OpenQA.Selenium.BiDi.Extensionsnamespace
Usage
Now user will get all power of spec defined methods. If user starts typing bidi.Network.interce he will be promoted to use:
AddInterceptAsyncnative low-level methodInterceptRequestAsync/InterceptResponseAsyncextension methods safe to do the interception properly
Note
There is:
context.Network.IntercepRequestAsync()If we choose extensions .net model, then properties cannot be extensions. I guess we can mitigate it via flatten methods from all modules, like:
context.InterceptRequestAsync()It is even simpler, and it even removes extra class.
Have you considered any alternatives or workarounds?
No response