Re:CasperJS 1.0 stable released
by reledi on Monday December 24, 2012 @01:37PM
(#4963674)
Can anyone compare this to Selenium? Which do you prefer to use and why?
[ Parent
| on HN ]
Re:CasperJS 1.0 stable released
by iso-8859-1 on Monday December 24, 2012 @06:41PM
(#4964501)
If you have a single-page JavaScript application, I would use CasperJS. The JavaScript engines are functionally almost equal if you use frameworks. The usual "clickAndWait" Selenium verb doesn't work with single-page apps since it expects the page to reload. See http://stackoverflow.com/questions/3703458/click-clickandwai... Obviously, this is not a problem with CasperJS and PhantomJS, they are much more tightly integrated with the browser, and you can click elements by ID without needing the ugly "waitForElementPresent" hack. The only issue I've had with CasperJS/PhantomJS is that you can't reliably test Emscriptened apps since the QtWebkit version is old and doesn't have Float64Array support.
If you want to test for layout issues, or if you need something more stable, use Selenium. PhantomJS 1.8 has WebDriver support: http://phantomjs.org/release-1.8.html If you want headless Selenium.