5 ms·
Ask HN: Scriptable command line browser?
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?
- cschneid 17y agoSomething I've looked at: http://htmlunit.sourceforge.net/ http://htmlunit.sourceforge.net/ Also, I'm not sure how they do it, but Jaxer (http://www.jaxer.org/ http://www.jaxer.org/) has a headless firefox instance they use. Maybe do it in a similar manner?
- joshu 17y agoI can't find anything about a headless firefox on the jaxer site. I thought it was server-side javascript?
- cschneid 17y agoJaxer 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.
- joshu 17y agoYeah, 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?
- ShabbyDoo 17y ago++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.
- adatta02 17y agoit sounds like Jaxer has a build of SpiderMonkey running inside it which provides server side JS support.
- coffee 17y agoIf 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-behavioral-driven.html http://jjinux.blogspot.com/2009/10/ruby-introduction-to-beha... - Should be a good starting point...
- macemoneta 17y agoLynx 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/ http://www.lynxbrowser.com/
- Shamiq 17y agoWait, so Selenium RC not hitting the spot for you?
- adatta02 17y agoSelenium 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.
- jerf 17y agoIt 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!
- Shamiq 17y agohttp://celerity.rubyforge.org/ http://celerity.rubyforge.org/ OR http://wiki.openqa.org/display/WTR/FireWatir/ http://wiki.openqa.org/display/WTR/FireWatir/
- vorador 17y agoHave you considered using script(1) ?
- leif 17y agouzbl is interesting, but I don't think it's exactly what you're looking for
- agazso 17y agoIf 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 http://watir.com.
- flashingpumpkin 17y agoI think Twill might suit you. Have a look at the example. http://twill.idyll.org/examples.html http://twill.idyll.org/examples.html
- vithlani 17y agoPlease take a look at Chickenfoot http://groups.csail.mit.edu/uid/chickenfoot/index.php 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.
- jamesbritt 17y agoA 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 http://github.com/dbrady/tourbus
- rudin 17y agoMaybe 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.