Forum: Ruby on Rails Testing Java Script in a View

Posted by Rails Learner (railslearner)
on 2010-02-08 22:01

Hello Everybody,

I am a newbie with rails, so please forgive me if I made a mistake.

I have a link in a view that uses java script to toggle a div.

Now, I need to test this. But I simply don't know how to trigger
the action of clicking on a link (to toggle the page element) in a test.

I have done an exhaustive search, but it was fruitless.

Any help is much appreciated.

Thanks a lot!!!!!!!
Posted by Robert K. (prenethus)
on 2010-02-08 22:17
Hey,

checkout Selenium (http://seleniumhq.org/). You can use that with webrat 
and/or cucumber to test javascript within your browser.

Robert
Posted by Rails Learner (railslearner)
on 2010-02-09 14:43
Robert K. wrote:
> Hey,
> 
> checkout Selenium (http://seleniumhq.org/). You can use that with webrat 
> and/or cucumber to test javascript within your browser.
> 
> Robert

Hi Robert,

Thanks for your reply.
I have heard of it and will definitely give it a shot.

Thanks a lot!!!!!!
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.