

PhantomJS, Selenium, and Django: Headless Browser Testing for the Rest of Us - croby
http://roverdotcom.github.io/blog/2013/12/12/phantomjs-selenium-and-django-headless-browser-testing-for-the-rest-of-us/

======
cmwelsh
For Firefox support, there is SlimerJS, a PhantomJS alternative that is coming
along very nicely for testing your websites on the Gecko rendering engine. It
even supports WebGL. Try it as an alternative CasperJS engine:

[http://casperjs.org/](http://casperjs.org/)

------
ed_blackburn
Two questions from a none Python developer.

\- If there are no Python bindings, could one invoke native bindings from with
Python? \- Is it normal to add a base class for utility rather than use a
field level instance?

Yours, curiously.

------
Stal3r
We tried phantomjs for a while but it was very unstable (regularly crashed and
since it's open source, bug reports often go ignored, even with stack traces),
undocumented behavior, and fairly unusual ecosystem. I believe phantom made a
fundamental mistake of not being nodejs based in the first place. Phantom has
some really nice features though, like being able to read the console output.
Selenium is kind of a joke in terms of features, but at least it's stable. I
would choose selenium unless you get a specific benefit out of phantomjs.

~~~
hugs
What features do you believe are missing in Selenium?

------
tthomas48
Selenium is awesome. I'm using it in Java and PHP. I had a run in with it in
its 1.x days and it was too unreliable to maintain the tests. Now it's
fantastic.

~~~
eterm
Which php driver do you use?

~~~
tthomas48
facebook/webdriver

------
vezzy-fnord
Easiest acceptance testing framework I've used is Splinter. It's an
abstraction layer over Selenium that practically makes writing tests similar
to plain English:
[http://splinter.cobrateam.info/](http://splinter.cobrateam.info/)

~~~
marekmroz
Admittedly, I only took a cursory look at Splinter, but in my opinion Robot
Framework[1][2] is much closer to plain English. This can be good if you know
what you're doing and can come up with consistent naming and test/keyword
organization conventions, or bad if used by someone without basic
understanding of a concept of a function, white space delimiters, etc.

Still, it is super flexible, and I enjoyed using is a lot. Nice feature is
having executable requirements if BDD is used. I.e. you can implement keywords
to execute given-when-then req's and they became your test.

[1]([http://robotframework.org/](http://robotframework.org/))
[2]([http://code.google.com/p/robotframework/](http://code.google.com/p/robotframework/))

------
jsnk
PhantomJS is awesome for speed, but I noticed that it sometimes doesn't render
iframe elements, ajaxed elements properly while using just Firefox does render
all elements correctly.

~~~
baudehlo
Are you sure you just weren't waiting long enough for them to load? Phantom's
onLoadFinished only takes into account the main frame, not any iFrame or AJAX
resources. For that you need some sort of DOM based waitFor().

