Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by hinathan on Wednesday January 26, 2011 @12:42AM
(#2142310)
This is really slick. It's tempting to think of this as a potential route towards headless functional testing — probably no substitute for something as heavy as selenium but for light tasks and DOM-based inspection of returned payloads (and screenshots, baked in!) it seems like a plausible foundation.
[ Parent
| on HN ]
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by ehsanul on Wednesday January 26, 2011 @01:35AM
(#2142392)
Also note these other headless javascript testing frameworks:
Zombie.js: http://news.ycombinator.com/item?id=2038663
HTMLUnit: http://htmlunit.sourceforge.net/
Celerity (JRuby wrapper around HTMLUnit): http://celerity.rubyforge.org/
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by xtacy on Wednesday January 26, 2011 @01:53AM
(#2142427)
I think the main differentiating factor between phantomjs and the above mentioned ones is that phantomjs actually uses WebKit and has full support for everything that WebKit supports. Zombie.js uses the DOM API due to jsdom, which might have its own parsing intricacies.
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by regularfry on Wednesday January 26, 2011 @10:13AM
(#2143490)
HTMLUnit has its own share of parsing gotchas.
I've used Selenium with Firefox and Xvfb to do headless scraping in the past; looks like my toolkit just got simpler.
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by endtime on Wednesday January 26, 2011 @03:47AM
(#2142640)
I don't know that any of those support SVG. If you want to render e.g. Raphael.JS drawings on the server, headless JS with SVG DOM support is pretty useful.
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by Torn on Wednesday January 26, 2011 @04:46AM
(#2142766)
That actually sounds like a really neat idea - throwing together a PhantomJS script that scrapes the content of a particular div containing Raphael or Flot and then renders as png.
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by endtime on Wednesday January 26, 2011 @11:49AM
(#2143850)
Yeah, we're doing it with wkhtmltoimage right now, which works but makes me cringe every time I think about it.
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by pak on Wednesday January 26, 2011 @01:12AM
(#2142357)
I think the main difference for me between this and Selenium would be that Selenium offers some macros to click an element, or simulate a drag and drop between two elements. If you added those in here--wouldn't be too much more, I don't think--you'd have a competitive testing framework, albeit Webkit-only.
Re:PhantomJS is a minimalistic, headless, WebKit-based, Java...
by adatta02 on Wednesday January 26, 2011 @01:14AM
(#2142361)
Assuming you could get jQuery to run inside this it should be pretty straight forward to translate the Selenium IDE's Selenese commands into jQuery statements.
I'm going to have to give this a run tomorrow in the AM.