Coder Social home page Coder Social logo

nhtmlunit's Introduction

NHtmlUnit

Build Status

NHtmlUnit is a .NET wrapper of HtmlUnit; a "GUI-less browser for Java programs".

Introduction

We really like the HtmlUnit project, which enables headless web testing without needing to have a complete browser running. By using IKVM it is possible to convert the HtmlUnit Java library for use on Microsoft's .NET platform.

However, it doesn't feel very natural to use a Java library in a .NET language, and therefore we created an HtmlUnit wrapper written in C#, so you can write tests for your web pages in clean C# code (or any code running on the .NET platform).

Downloading NHtmlUnit

The recommended way to download NHtmlUnit is through its NuGet package. If you want to build it yourself, read the next section.

Building NHtmlUnit

If you want to build your own version of NHtmlUnit, you can use MSBuild or Visual Studio 2010.

After building you can find NHtmlUnit.dll plus its dependencies here:

  • app\NHtmlUnit\bin\Debug
  • app\NHtmlUnit\bin\Release

Usage

For now there is no manual or API reference written for NHtmlUnit. You can however use the HtmlUnit reference, as this wrapper almost completely reflects the original API.

The difference is that Java iterators, lists and collections are exposed as their .NET-friendly counterparts (IEnumerable, IList and ICollection). In addition, properties are "real" .NET properties, so obj.getSomething() and obj.setSomething() is exposed as obj.Something with a public getter and setter.

NHtmlUnitGenerator

The NHtmlUnitGenerator executable only needs to be run when the HtmlUnit jar file has changed. When NHtmlUnitGenerator is run it will overwrite all files in app\NHtmlUnit\Generated.

Note that it doesn't do anything with the project files, so if classes are added or removed from the origin HtmlUnit jar file this will not be synchronized. You have to manually add new files to the project.

License

NHtmlUnit is licensed under the Apache License Version 2.0, which is the same license used for HtmlUnit.

Technical details

NHtmlUnit has in large parts been auto-generated using the HtmlUnit jar file as input to the excellent IKVM project. How it is generated can be seen in the Make.cmd file located inside the lib/NHtmlUnit folder.

Although we consider NHtmlUnit itself to be of decent quality, the NHtmlUnitGenerator is basically a large hack.

Future

A complete rewrite of the NHtmlUnitGenerator using Mono.Cecil would be nice, although we're unsure exactly how much this would do for the final product.

Authours

NHtmlUnit was written by @asbjornu and @beewarloc.

nhtmlunit's People

Contributors

asbjornu avatar timorzadir avatar beewarloc avatar jonanders avatar

Watchers

Eric avatar  avatar

Forkers

2734796332

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.