aspose file tools*
The moose likes Testing and the fly likes Selenium or HtmlUnit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Selenium or HtmlUnit" Watch "Selenium or HtmlUnit" New topic
Author

Selenium or HtmlUnit

Victor M. Pereira
Ranch Hand

Joined: Mar 02, 2012
Posts: 50
I've been wondering for a while which presentation testing framework to use. I know that HtmlUnit simulates a browser and is merciless on bugs that other explorers simply ignore.
I also know that Selenium uses real explorers and through them tests the page. The question is which one should I choose, since some things can't be automatically tested like how a page looks.
However for the things that can be automatically tested, does it really matter which framework I use. In which case does choosing one over the other makes a real impact?


regards,
Victor M. Pereira
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Exactly how complex are these HTML pages you want to test and how deep is the user interaction?

Bill
Victor M. Pereira
Ranch Hand

Joined: Mar 02, 2012
Posts: 50
It's more for TDD, though I expect to use jQuery and a couple of google code javascript libraries for graphs and charts. I don't expect to use drag and drop, but there is always the chance. I do want it with Ajax.

So the question would be more focused as in: if you're starting a project with TDD which one would you choose. Assuming the maximum cross-browser compatibility
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
I have not looked at Selenium or HtmlUnit so have no suggestion there.

When I did this sort of thing some years ago it seemed easier to write a custom user simulator based on the Apache HttpClient toolkit and a script written in XML to carry a "user" through a long sequence of pages and states.

Given the large number of toolkits you plan to use, trying to test all pathways in the finished application looks pretty difficult. My inclination would be to devise simplified sub-systems which could be tested outside the full environment.

Bill


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Selenium or HtmlUnit