Java (12)


HtmlUnit for .NET Headless Browser Automation

HtmlUnit for .NET Headless Browser Automation is possible, as conversion from java to .NET is a far simpler process than you would imagine.

Steps to do conversion of HtmlUnit from Java to .NET are:-

  • Download HtmlUnit (as a compiled JAR file) from SourceForge and extract all its files from the ZIP archive.
  • Download IKVM binaries from ikvm.net/SourceForge, and again extract all its files from the ZIP archive.
  • Open a command prompt, ensure you’ve added IKVM’s /bin folder to your PATH variable, change directory to
  • HtmlUnit’s /lib folder, and then run ikvmc to convert the Java bytecode of all of the HtmlUnit JAR files into .NET bytecode.
  • Command to run (replace x.x with the version you downloaded)
  • Run command:- ikvmc out:htmlunit-x.x.dll *.jar
  • In Visual Studio (2010), create a new solution with a test projects
  • Add all HtmlUnit and IKVM DLLs to References folder
  • Clean and ReBuild

You are now ready to create some HtmlUnit driven tests!

There are several options to run these tests – I prefer to use NUnit (which can be added as an external tool to VS2010)




HTMLUnit and Proxies

Proxies are bain of automated testing, but there is simple way to both create a profile add proxy details, along with username and password (often forgotten in proxy tutorials). Here is the Java code that solves issue, when using Selenium Web Driver and HTMLUnit.




Groovy DSL

The gap between language-driven requirements and code is getting smaller, but for some reason it is taking us all a while to realise that programming languages have to become more readable. If you look a piece of any code, you will dereive things that you understand. If you remove all that you understand from the program and paste it in another doc, the chances are you will have (more of less) a description of what the code is doing, that you (and others) can understand.




Grammar-oriented programming

What the biggest risk in development (leaving out frightening common omission of unit testing)?   That what is written down as requirements suffers a chinese-whispers style path to code.  TDD was an approach to address that risk, by saying that before functional coding starts as test based on requirement is derived, then functional coding done to pass the test.   Oversimplifying the nuts and bolts, but that is general idea.




DroidDraw

droid draw

The excellent DroidDraw is now available as standalone application (Linux included!). Java programmers may sniff, but the history and evolution of web development is ongoing creation of accessible tools for people to build on the web. It doesn’t pretend to be anything other than a basic android application designer. If you want to do something more complex, then try more heavyweight method.

droid draw