tryolabs/requestium

Allow the Requestium session to replace its Selenium driver with an external driver instance

joaqo opened this issue · 4 comments

joaqo commented

In codebases that already have lots of Selenium code, but that need some of Requestium's features, it could be useful to plug an already running Selenium driver instance into a Requestium Session.

Things to consider:

  • We need to add some methods to this external object for it to have all of the features Requestium adds. Probably the best way to do this would be to iterate over the methods in the DriverMixin class and add them to the external object. Probably something like this should work: http://zderadicka.eu/dynamically-mix-in-methods-into-an-instance-in-python/
  • We need to check not to overwrite any methods that have the same name in the external object, except when the external object is a RequestiumPhantomJS or RequestiumChrome object. This way we can switch drivers between different Requestium Session objects, I dont think this is a particularly useful thing to do, but we should still allow it to happen.

The need for this use case was brought up by @limpair in #29 so thanks a lot for your contributions!

Any updates to this?

joaqo commented

There is no plan on our side to add this, but @lordjabez is the current maintainer, so it's up to him.

Hi @Dotolox apologies for my delayed response. I can review and merge a pull request if you want to take a crack at implementing, but right now I don't have time to implement new features.

Added this capability in v0.1.12 (4742f8f).