Total NOOB Question about Rails and Selenium


#1

Howdy everyone,

Sorry for the newbie question but I’m really having some difficulty here

  • I
    want to add Selenium tests to my Rails application and I just can’t find
    a
    way to do it. I found the SeleniumIntegration page on the Rails wiki -
    didn’t work for me. I tried just putting the selenium directory under
    my
    app’s public folder - bet you can guess what happened…yep routing
    error.
    I searched for routing information and found the Routing manual but it
    looks
    like it’s only for Controllers and Actions. I tried finding how the
    static
    content is served from the public folder but I never did find anything.

Please help. /Any/ assistance would be greatly appreciated. Please ask
questions - I’m sure I did something wrong - I just don’t know what.
Steps
to follow, documents to read, api to study - any help would be very
nice.

Here’s some of my environment information:
WinXP Pro
C:>ruby -v
ruby 1.8.2 (2004-12-25) [i386-mswin32]

C:>gem list

C:>“C:\Ruby\ruby\bin\ruby.exe” “C:\Ruby\ruby\bin\gem” list

*** LOCAL GEMS ***

actionmailer (1.1.3)
Service layer for easy email delivery and testing.

actionpack (1.11.0)
Web-flow and rendering framework putting the VC in MVC.

actionwebservice (0.9.3)
Web service support for Action Pack.

activerecord (1.13.0)
Implements the ActiveRecord pattern for ORM.

activesupport (1.2.3)
Support and utility classes used by the Rails framework.

fxri (0.3.2)
Graphical interface to the RI documentation, with search engine.

fxruby (1.2.6)
FXRuby is the Ruby binding to the FOX GUI toolkit.

rails (0.14.3)
Web-application framework with template engine, control-flow layer,
and ORM.

rake (0.6.2, 0.5.4)
Ruby based make-like utility.

ruby-json (1.1.1)
ruby-json is a library for using the JavaScript Object Notation
(JSON) under Ruby.

selenium (0.2.468)
Selenium is a test tool for web applications. Note that this is an
unofficial build of Selenium based on changeset 468 from the
Selenium subversion repository.

sources (0.0.1)
This package provides download sources for remote gem installation

sqlite3-ruby (1.1.0)
SQLite3/Ruby is a module to allow Ruby scripts to interface with a
SQLite database.

C:>

Cheers,

Mel

P.S. I’d like to use the latest version of Selenium if possible.


#2

Hi !

2005/12/6, Mel R. removed_email_address@domain.invalid:

Sorry for the newbie question but I’m really having some difficulty here -
I want to add Selenium tests to my Rails application and I just can’t find a
way to do it. I found the SeleniumIntegration page on the Rails wiki -

If you put something under public/, Rails should serve it from there.
It depends on how you serve your application. Are you under WEBrick,
Apache or Lighttpd ?

If you use Apache or Lighttpd, you’ll have to change your rewrite
rules so that the files under the Selenium folder are served directly.

Hope that helps !


#3

Doh! I forgot to include the vital piece of information, eh? Yeah - I’m
using WEBrick right now. Not sure to which webserver I’ll deploy.


#4

Mel R. wrote:

never did find anything.
There’s a new article covering the use of Selenium with Rails at IBM
DeveloperWorks:

http://www-128.ibm.com/developerworks/java/library/wa-selenium-ajax/index.html?ca=drs

It covers Fit-style, rather than driven, test execution.

There’s a downloadable zip file containing an example Rails/Ajax
application plus the Selenium framework and the tests - and it Just
Works.

Thanks to Sean H. for flagging this in another thread.

regards

Justin


#5

Mel R. wrote:

never did find anything.

Please help. /Any/ assistance would be greatly appreciated. Please ask
questions - I’m sure I did something wrong - I just don’t know what.
Steps to follow, documents to read, api to study - any help would be
very nice.

Here’s some of my environment information:
WinXP Pro

[snip]

P.S. I’d like to use the latest version of Selenium if possible.

I am aiming to use Selenium with Rails - thanks for pointing out the
Wiki page (which in turn points to a Trac ticket with proposed patches
etc.). I need a little time to get up to date on what already exists,
and to try it for myself, but I’ll be happy to share experience and
ideas. There was another post on the list about this very recently

http://article.gmane.org/gmane.comp.lang.ruby.rails/31523

but it was posted anonymously via RForum :frowning:

(I also noticed that Bret P.,

http://www.io.com/~wazmo/blog/

made a recent change on the Wiki page.)

Whereas that anonymous post, and Jon Tirsen’s posts back in April, when
he created the Wiki page,

http://article.gmane.org/gmane.comp.lang.ruby.rails/8401

suggest that Selenium integration should be included in Rails itself, my
guess is that plugin + generator would be the way to go.

Given that you are using Windows, and to let you make progress on
Selenium tests independently of getting integration with Rails sorted
out, have you tried the HTA approach?

regards

Justin