# Doubt in Selenium test

**URL:** <https://www.ruby-forum.com/t/doubt-in-selenium-test/73685>\
**Category:** Rails\
**Created:** [October 26, 2006, 8:58am UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685 "2006-10-26T08:58:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 26, 2006, 8:58am UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/1 "2006-10-26T08:58:46Z")

</div>

Hi guys,

I am just started to do selenium test in rails. can u guys plz tell me  
how to write selenium test for the below code. for ex: i want to use  
click action in selenium test for the below code

Add a Short Media  
Buy

advance thx

regards,  
Karthick.

---

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 27, 2006, 2:23am UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/2 "2006-10-27T02:23:17Z")

</div>

If you’re doing Selenium testing with Rails, take a look at my plugin  
that  
uses Selenium-RC to directly control the browser and allows you to run  
Selenium tests just like other tests in Rails.

[http://svn.viney.net.nz/things/rails/plugins/selenium\_jelly](http://svn.viney.net.nz/things/rails/plugins/selenium_jelly)

As for your question, you should probably add an id to the tag so  
that  
it can be easily identified. Then simply use the Selenium ‘click’  
command to  
simulate a click.

 

-Jonathan.

---

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 27, 2006, 10:44am UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/3 "2006-10-27T10:44:50Z")

</div>

Jonathan V. wrote:

> If you’re doing Selenium testing with Rails, take a look at my plugin  
> that  
> uses Selenium-RC to directly control the browser and allows you to run  
> Selenium tests just like other tests in Rails.
> 
> [http://svn.viney.net.nz/things/rails/plugins/selenium\_jelly](http://svn.viney.net.nz/things/rails/plugins/selenium_jelly)
> 
> As for your question, you should probably add an id to the tag so  
> that  
> it can be easily identified. Then simply use the Selenium ‘click’  
> command to  
> simulate a click.
> 
>  
> 
> -Jonathan.

 

hi jonathan,

 

thx Jone, I have another problem in selenium test. the problem is, below  
code successfully run in IE but, the same test doesnot run in mozilla.  
in mozilla it run upto ‘type’ but it does not show any failiure.  
(note: in my Mozilla browser script has been enabled)

 

type ‘vendor’, ‘bb’  
key\_down ‘vendor’,98  
key\_down ‘vendor’,13

 

wait\_for\_text ‘vendor\_auto\_complete’, ‘BBC TV’  
verify\_text ‘vendor\_auto\_complete’,‘BBC TV’

 

key\_down ‘vendor’,13  
wait\_for\_value ‘vendor’, ‘BBC TV’  
verify\_value ‘vendor’, ‘BBC TV’

 

can u guys plz help me.

 

advance thx,  
Regards,  
Karthick.

---

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 27, 2006, 11:07am UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/4 "2006-10-27T11:07:57Z")

</div>

Narayana K. wrote:

> Jonathan V. wrote:
> 
> > If you’re doing Selenium testing with Rails, take a look at my plugin  
> > that  
> > uses Selenium-RC to directly control the browser and allows you to run  
> > Selenium tests just like other tests in Rails.
> > 
> > [http://svn.viney.net.nz/things/rails/plugins/selenium\_jelly](http://svn.viney.net.nz/things/rails/plugins/selenium_jelly)
> > 
> > As for your question, you should probably add an id to the tag so  
> > that  
> > it can be easily identified. Then simply use the Selenium ‘click’  
> > command to  
> > simulate a click.
> > 
> >  
> > 
> > -Jonathan.
> 
>  
> 
> hi jonathan,
> 
>  
> 
> thx Jone, I have another problem in selenium test. the problem is, below  
> code successfully run in IE but, the same test doesnot run in mozilla.  
> in mozilla it run upto ‘type’ but it does not show any failiure.  
> (note: in my Mozilla browser script has been enabled)
> 
>  
> 
> type ‘vendor’, ‘bb’  
> key\_down ‘vendor’,98  
> key\_down ‘vendor’,13
> 
>  
> 
> wait\_for\_text ‘vendor\_auto\_complete’, ‘BBC TV’  
> verify\_text ‘vendor\_auto\_complete’,‘BBC TV’
> 
>  
> 
> key\_down ‘vendor’,13  
> wait\_for\_value ‘vendor’, ‘BBC TV’  
> verify\_value ‘vendor’, ‘BBC TV’
> 
>  
> 
> can u guys plz help me.
> 
>  
> 
> advance thx,  
> Regards,  
> Karthick.

 

sorry guys  
i had mentioned wrongly, the thing is  
test stops exactly at ‘wait\_for\_text’ command not at ‘type’ command in  
mozila browser.  
guys plz help me to overcome this problem

 

advance thx  
regards  
Karthick.

---

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 27, 2006, 11:09am UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/5 "2006-10-27T11:09:17Z")

</div>

that looks really promising, gonna give it a try when i come home …

Thanks!

---

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 29, 2006, 3:28pm UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/6 "2006-10-29T15:28:58Z")

</div>

i’m an idiot, replied to the wrong topic. my apologies.

---

<div class="post-metadata">

**Author:** ![narayana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f6c823/32.png) [@narayana](https://www.ruby-forum.com/u/narayana)\
**Post date:** [October 27, 2006, 3:51pm UTC](https://www.ruby-forum.com/t/doubt-in-selenium-test/73685/7 "2006-10-27T15:51:44Z")

</div>

Thorsten L wrote:

> that looks really promising, gonna give it a try when i come home …
> 
> Thanks!

Hi guys,

Finally i found the solution for the above problem  
the thing is I have to use key\_press command for mozilla  
key\_down command for IE

am using both commands in my test.  
regards,  
Karthick.
