-
Notifications
You must be signed in to change notification settings - Fork 783
Add HTMLUnit remote driver support #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Cool thanks for the patch, I'll merge it in. Question for you. Would your team want a Start Server keyword that actually starts the HTMLUnit server or do you handle that some other way? j1z0 |
Add HTMLUnit remote driver support
Thanks! We actually run selenium-server indefinitely on a dedicated test machine so we wouldn't have an immediate need for such a feature. I do feel that it could be quite useful down the road though as we increase our test/runner volume. Cheers! |
I have already tested this patch on my machine as well, it works great for my simple test. My question for @SoCalLongbroad is that for your project how stable is the html unit? do you notice some js related issue? any tips to prevent them? Any thing is that I got some exception when I try to run this over selenium grid 2, it seems that I have to start the node with some specific settings, I will feedback when I have more result. |
For our own purposes, we don't engage the JavaScript support but that support was presented as available in the original driver so I included in the manner the upstream sources recommended. I haven't had the occasion to vet the HTMLUnit support within selenium-server where I've had to engage and JavaScript-specific features. I would expect that, given that the HTMLUnit support is implicit to selenium-server, said support could fluctuate across selenium-server releases. For our own testing world, we're primarily concerned with the accumulation of cookie information after a series of requests, whether redirects behave normally, and whether user optouts result in the correct influence upon the requests. You can check us out at http://www aggregateknowledge.com/ to get a sense of what our business is/does. |
I do see a number of open issues on the selenium side which reference the HTMLUnit support: One which might be significant is this one: What issues/errors do you see from your tests? |
Out of curiosity, I did a brief exercise in Ruby/irb using the latest selenium-webdriver gem and a pair of selenium-server instances. Against a stand-alone selenium-server, I can create the driver without problems: 1.9.3p194 :009 > caps = Selenium::WebDriver::Remote::Capabilities.htmlunit(:javascript_enabled => true) If the target selenium-server happens to be running in 'hub' mode, attempts to instantiate the driver in the manner shown above yields an error: Selenium::WebDriver::Error::UnknownError: Error forwarding the new session cannot find : {platform=ANY, javascriptEnabled=true, cssSelectorsEnabled=false, browserName=htmlunit, nativeEvents=false, rotatable=false, takesScreenshot=false, version=} (org.openqa.grid.common.exception.GridException) ...and the driver does not instantiate. My assumption here is that the hang-up is on the selenium-server side of the equation. It may just be a limitation of the HTMLUnit support of the driver to only work against standalone selenium-server and not in the grid2 (hub/nodes) context. |
I've added support for the HTMLUnit remote driver to support headless execution against a selenium-server. Feel free to incorporate if you like. We're currently using this addition in-house at my workplace.
To initiate a session, I employ this keyword:
Also included is support for the HTMLUnit driver with Javascript support.