Warning: This is a long message catalogueing the state of so-called
"headless" browser solutions for the .NET world, tangentially
discussing other language platforms, and how well they do or don't
play with WebDriver. If this holds no appeal for you, you'd probably
do best to just skip this message altogether.
I'm going to piggyback off of this thread to expand on a point Mark
Collin brought up. There's really nothing quite like HtmlUnit in
the .NET space. I understand the impulse not to want to introduce
non-.NET stuff into the environment. I had many of the same concerns,
but I've come around to Simon's points of "it's Just Another Binary"
and "nobody actually browses the web with a headless browser".
However, I also realize that using a Java .jar isn't just an xcopy
deployment if you don't already have the Java runtime installed, and
in a "pure" (whatever that means) .NET shop, you may not.
Because of some institutional resistance to Java at some places, I've
spent some time looking into alternative "headless" projects. Here's a
summary of what I've found:
XBrowser[1] - I actually started a headless .NET browser called Crane,
but abandoned it when Nathan Ridley contacted me about his XBrowser
project. At one time, he was still using my .NET HTML parser. Good
chap, but very busy, and the .NET JavaScript implementations up to
this point haven't been up to the task, so no JS engine yet, and no
activity on the project in 6 months. One thing I learned while working
on the project is that creating a web browser is bloody *hard*. Feel
free to contact me off-list if you'd like to pick up the ball with
this one.
WebKitDriver[2] - This project is referenced on the Selenium project
Google Code home page, and uses a headless WebKit implementation. That
means it uses a "real" browser engine implementation as WebKit is used
by Safari and Chrome. The bad news is that it only has Java bindings,
and there seems to be little response to pressure from outside the
project to change that.
Envjs[3] - This is a JavaScript implementation, originally started by
John Resig (of jQuery fame). Needs a .NET JavaScript REPL and some
custom JavaScript work to be accessible from .NET.
Phantom.js[4] - Another headless WebKit implementation, but with a
JavaScript API, implemented as a C++ executable, compiled for specific
platforms. It's downside is that it doesn't act as a resident process
that you can communicate with and control. Rather, it runs a single
JavaScript script, then exits. Having said that, there is an issue in
their issue list to create a WebDriver-compliant driver, and the
project is under active development. Built statically, this would
amount to an xcopy-deployable project.
webdriver-zombie[5] - This is a WebDriver implementation built to
drive the Zombie.js headless browser. This project is brand-new. Like
the first commit was yesterday. It's based on node.js, which is
getting lots of pub lately. That doesn't help Windows users in the
slightest at present, but the node project has a stated goal of native
Windows support (experimental in 0.5, stable in 0.6), so there's
potential there. When (if) the native Windows support materializes for
node, this would also amount to an xcopy-deployable project.
So if an xcopy-deployable binary solution is okay with your dev
department, there are a couple of options under development that show
promise, even if they're not yet available. Contacting those project
owners and getting involved would probably speed up the process of
getting WebDriver-compliant drivers build and available. If you can
talk them into an installable solution, you can use HtmlUnit via
RemoteWebDriver today. If they're going to insist on a .NET-only
binary, you can continue down the path of your IKVM solution, or you
can write your own headless browser, maybe building on the foundation
of Crane/XBrowser. In any case, I wouldn't expect any of these
solutions to land in the WebDriver trunk anytime soon, but I suspect
the Selenium ecosystem is large enough to encompass other projects
that provide different implementations of the Selenium WebDriver APIs,
even as independent OSS projects.
Regards,
--Jim
[1]
https://github.com/axefrog/XBrowser
[2]
http://webkitdriver.googlecode.com/
[3]
http://www.envjs.com/
[4]
http://www.phantomjs.org/
[5]
https://github.com/90kts/webdriver-zombie
On May 17, 10:07 am, Paul Hammant <
p...@hammant.org> wrote:
> On Tue, May 17, 2011 at 5:43 AM, Simon Stewart <
simon.m.stew...@gmail.com>wrote: