# Doing Selenium tests and :confirm inside a link\_to\_remote does not work

**URL:** <https://www.ruby-forum.com/t/doing-selenium-tests-and-confirm-inside-a-link-to-remote-does-not-work/144155>\
**Category:** Rails\
**Created:** [July 25, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/doing-selenium-tests-and-confirm-inside-a-link-to-remote-does-not-work/144155 "2008-07-25T23:17:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.francisco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58f4c7/32.png) [@j.francisco](https://www.ruby-forum.com/u/j.francisco)\
**Post date:** [July 25, 2008, 11:17pm UTC](https://www.ruby-forum.com/t/doing-selenium-tests-and-confirm-inside-a-link-to-remote-does-not-work/144155/1 "2008-07-25T23:17:12Z")

</div>

Hello there.  
I have a problem doing Selenium tests.  
When I try to test my delete method doesn’t prompt me the respective  
alert which otherwise would appears before run the destroy method on  
the controller.  
Without Selenium the application prompt me as the regular way but  
within Selenium things go badly.

Here is a part of my view:  
\<%=link\_to\_remote image\_tag(’/images/trash\_can.gif’, :border =\> 0),  
:confirm =\> ‘Delete Schema ‘+schema.name+’?’,  
:url=\>{:controller=\>:schema,:action=\>:delete,:id=\>schema.id},  
:before=\>"$(‘shownDiv#{schema.id}’).visualEffect(‘highlight’,  
{duration:3});",  
:complete=\>"$(‘shownDiv#{schema.id}’).shrink();$  
(‘inline#{schema.id}’).hide();"%\>

Yes, I am using a bit of RJS, is that what cause this weird behavior?  
And in the controller I have.

def delete  
@schema = Schema.find(params[:id])  
@schema.destroy  
respond\_to do |format|  
format.js  
end  
end

Actually my main concern if this behavior could impact negatively in  
the performance of the application in other different environments,  
let’s say, browsers.

Thanks!!
