Tue, 26 Apr 2016 06:36:41 -0700 (PDT) Charles Wesley
<
charles...@gmail.com>:
> Is it possible to instantiate a WebDriver object from inside a web
> application? Our team has a Maven Java project where we instantiate
> a WebDriver object to perform some UI-based configuration on our
> behalf.
If what you want to achieve is to re-use the session that started and
controls the browser from within a content document, you may be
interested in WebDriver.js.
It implements a “meta-circular” client that allows an in-content JS
client to assume control over the existing WebDriver session. This
would let you control the browser from within the document.
> Now we want to take some of the classes from that project,
> compile them, and call them from within a web application. Is this
> feasible?
What you’re talking about here is a content JS-to-Java bridge. I’m not
sure about the feasibility of that. What you’d need is a wire protocol
for the document to be able to RPC the Java process. This is, in
essence, what WebDriver provides for the WebDriver API.