Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Scriptable command line browser?
17 points by adatta02 on Nov 15, 2009 | hide | past | favorite | 19 comments
Basically what I'm looking to do is use Selenium IDE (http://seleniumhq.org/) on Firefox to generate some regression tests but then I want to replay them without having to fire up X11 and Firefox.

I found ELinks (http://elinks.or.cz) which is a text based browser with Lua support but it seems like it would be a good amount of work to write a Selenium binding.

Anyone know anything better?



Lynx can record a session and play it back, which makes it easy to create tests. The sessions are easily edited too. It's available in the repositories of most Linux distributions, or here:

http://www.lynxbrowser.com/


Something I've looked at: http://htmlunit.sourceforge.net/

Also, I'm not sure how they do it, but Jaxer (http://www.jaxer.org/) has a headless firefox instance they use. Maybe do it in a similar manner?


++1 for HtmlUnit. I'm now writing selenium tests for a GWT app that I'll "play" on various browsers to verify correctness, but I'll run them on HtmlUnit as part of the post-build regression tests.


I can't find anything about a headless firefox on the jaxer site. I thought it was server-side javascript?


Jaxer is server side javascript, with access to a DOM. When I looked at it (more than a year ago now), they accomplished that via a headless firefox 3. I'd guess they still do that, since it worked for them.


Yeah, I just assumed it was a javascript interpreter with a DOM. (Obviously you don't need a whole browser for that.)

I wonder what the performance implications are. Firefox seems way too... single-threaded?


it sounds like Jaxer has a build of SpiderMonkey running inside it which provides server side JS support.


A tool such as Tourbus might work. It's a Ruby app meant to stress test Web sites. It uses Webrat and (I think) Mechanize underneath, and does not open any browsers.

If the site in question has scripting you're out of luck, but otherwise it should be quite useful.

In fact, I found yourself using both Tourbus and Selenium on a project, and decided I didn't want to have duplicate tests, so I wrote some helper code to allow Tourbus to execute my Selenium scripts. So far, so good. I can record the actions in the Selenium 'IDE' plugin, and use them in Tourbus.

http://github.com/dbrady/tourbus


If all you want is server side automation, then you can try Xvfb, which is a virtual X server capable of running X applications.

On a related subject I used Watin (.net) for browser automation and learned, that it was modeled after Watir, which is the same in ruby. See http://watir.com.


If into Ruby, I saw a presentation on how to do what your looking for, check out: http://jjinux.blogspot.com/2009/10/ruby-introduction-to-beha... - Should be a good starting point...


I think Twill might suit you. Have a look at the example. http://twill.idyll.org/examples.html


Maybe give vimperator a try. It is a plugin for firefox that gives it a vim feeling. I think you can write scripts for it too.


Wait, so Selenium RC not hitting the spot for you?


Selenium RC starts Firefox instances though which means I'll have to be running a X11 server on our CI box. I actually gave this a whirl with Xvfb but it still uses tons of memory.


It seems to me you really ought to be regression testing against the actual browsers your users will be using, unless you do absolutely no Javascript, in which case why run browsers at all? What situation are you in where you have somehow slipped between the cracks of this logic? (The answer may help guide other people's advice.)

"It takes a lot of memory" has a simple solution, after all: More memory. Recovering the cost of even $200 of RAM only requires finding one bug before a customer did!



Have you considered using script(1) ?


uzbl is interesting, but I don't think it's exactly what you're looking for


Please take a look at Chickenfoot

http://groups.csail.mit.edu/uid/chickenfoot/index.php

maybe it does what you want? I was very impressed with a video I had seen about it a couple of years ago.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: