The trouble however with this method is that we will never know if it
executes the js or not or does what it is supposed to do.

Aidy

2009/1/8 aidy lewis <aidy.le...@googlemail.com>:
> Hi Tony,
>
> Certainly works, even though I have changed #click_no_wait to #click.
>
> I think we need to put this example in the js pop-up wiki and we need
> an example for alerts as well.
>
> For Firewatir you could re-open the FireWatir class and use  
> #$jssh_socket.send
>
> class FireWatir::Firefox
>  def close_js_confirm
>    $jssh_socket.send("[js]\n", 0)
>    self.read_socket()
>    sleep 1
>  end
> end
>
> Aidy
>
>
>
> 2009/1/8 Tony <ynot...@gmail.com>:
>>
>> Hi Aidy,
>>
>> Got the error -
>> The problem is the script disp_confirm is being called from a frame,
>> and its this frames disp_confirm and window_confirm, that should be
>> overridden.
>> So this should be done on the page and also for all frames. (which is
>> going to call your overridden function)
>>
>> require 'watir'
>> ie = Watir::IE.new
>> ie.goto("http://www.w3schools.com/JS/tryit.asp?
>> filename=tryjs_confirm")
>> ie.maximize
>> # override the frames window.confirm
>> ie.frame(:name, "view").document.parentWindow.execScript
>> ("window.confirm=function(){return true;}")
>> ie.frame(:name, "view").button(:value, "Display a confirm
>> box").click_no_wait
>>
>> Wow .. great way to get rid of these confirm boxes.. only have to get
>> this to work on firewatir tooo...
>> Anyways I have tried this on IE8 RC1 - 8.0.6001.18344
>>
>> - Tony
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to