[rspec-users] Selenium/Watir usage along side Webrat in story testing
lists at ruby-forum.com
Tue Jun 10 12:10:11 EDT 2008
My mind was stuck in Rspec but looking at this as an adapter for Webrat
is a great idea.
I've had a play with Webrat and a test Selenium adapter ala the
Mechanize one. Things start to get a little tricky around having to have
the domain defined first in the Selenium. Meaning in Selenium its hard
Status codes are also not great fun
(http://clearspace.openqa.org/message/8115#8115). I'll continue playing
with this and see how easy it will be to squeeze Selenium into the
>One could then perhaps create an extension of webrat's language to form
>a uniform way of expressing JS/AJAX behavior.
Sounds like a good idea. I guessing you mean some friendly wrapper to
something like: 'xml_http_request' in
Aswell as just Ajax/JS stuff as an ability to perform more advanced
interrogations (but always optional to keep the wonderful simplicity of
Webrat's usage) would be a nice addition to Webrat. Something similar to
Selenium's xpath like expressions. I'm not sure if Watir has something
The whole JS/AJAX behavior missing from Webrat has been making me look
at the introduction of Server-side JS. Things like:
Rhino(http://www.mozilla.org/rhino/). Whether its possible to push
forward what JS Webrat can handle (be it that its never going to be a
The real browser testing makes a lot of sense when examining different
browsers JS/CSS processing but there are a lot of use-cases where simple
DOM manipulation is good enough.
Ben Mabey wrote:
> Joseph Wilk wrote:
>> (I suspect Webrat represents the smallest set of functionality -
>> contributing to whatever project is going to be the best fit. So I'm
> Hey Joseph,
> Have you looked at webrat in github lately?
> Bryan is abstracting webrat so that different adapters can be plugged
> into it.. Meaning, the same wrappers/syntax can be used to drive rails,
> merb, mechanize, etc... I think a selenium or watir adapter for webrat
> would be awesome. I'm not too experienced with selenium but it doesn't
> strike me as being too hard to do. You make a good point in that webrat
> is a small subset of what the other JS aware frameworks can do but I
> think what webrat currently has would handle a lot of the use cases.
> One could then perhaps create an extension of webrat's language to form
> a uniform way of expressing JS/AJAX behaviour.
> The mechanize adapter idea is neat too, because you could then use it to
> test any website no matter what the implementation is. I know that part
> of Bryan's motivation behind the mechanize spike is to eventually use
> the stories to do performance testing as well.
> This is a problem I'm also interested in but I haven't yet needed to use
> selenium enough to make me want to do anything about it. :) I think the
> selenuim adapter for webrat approach would be a great way to approach
> this problem though. What do you think?
Posted via http://www.ruby-forum.com/.
More information about the rspec-users