MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

Ability to load html #349

Open kiamesdavies opened 4 years ago

kiamesdavies commented 4 years ago

Thank you for contributing to this project!

If you haven't already done so, please agree to the Contributor's License Agreement: https://github.com/MachinePublishers/jBrowserDriver/blob/master/CLA-rev2-digital.txt

You can edit that file to add your digital signature to the bottom.

hollingsworthd commented 4 years ago

Hello this is a great feature and thanks for creating it. I'm a little torn though, the intention of WebDriver is to support only all the interactions a user might have with a web page (and not go beyond that... although there are some grey areas). I wonder if it works to do driver.get("file:///somepath.html"); or driver.get("data:text/html;charset=utf-8," + someHtml)

Also I would be a little bit concerned about deviating from the Selenium API. And for embedded web servers in java there are lots of good options and hacking together a simple server can be done similar to https://github.com/MachinePublishers/jBrowserDriver/blob/master/src/com/machinepublishers/jbrowserdriver/diagnostics/HttpServer.java

I like the feature a lot but am not sure at this point about adding it.