[wtr-general] Re: overriding javascript

2009-01-08 Thread aidy lewis
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

[wtr-general] Re: overriding javascript

2009-01-08 Thread aidy lewis
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

[wtr-general] Re: overriding javascript

2009-01-08 Thread sai
I tried this require 'firewatir' class Element def close_js_confirm assert_exist @container.js_eval(window.confirm = function(){return true;}) sleep 1 end end ff = FireWatir::Firefox.new ff.goto(http://www.w3schools.com/JS/tryit.asp? filename=tryjs_confirm) ff.frame(:name,

[wtr-general] Re: overriding javascript

2009-01-08 Thread sai
sorry forgot to mention that it is working in firebug. So I am not sure why it is not workin in FireWatir On Jan 8, 6:34 pm, sai saidesertrose2...@gmail.com wrote: I tried this require 'firewatir' class Element   def close_js_confirm     assert_exist     @container.js_eval(window.confirm

[wtr-general] Re: overriding javascript

2009-01-07 Thread Tony
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

[wtr-general] Re: overriding javascript

2009-01-05 Thread aidy lewis
Hi Jagdeep, I am still unable to override the confirm function. The result should tell me that 'You pressed OK!'. It seems that execScript is running as a DOS window flashes, however I am just left with the dialog. Do I need to change some js settings in IE. Aidy 2009/1/5 Jagdeep Jain

[wtr-general] Re: overriding javascript

2009-01-04 Thread Jagdeep Jain
Hi Aidy, I have changed disp_confirm with the earlier one you have supplied window.confirm and removed JavaScript from the end and it works fine for me. require 'watir' ie = Watir::IE.new ie.goto(http://www.w3schools.com/JS/tryit.asp? filename=tryjs_confirm) ie.maximize

[wtr-general] Re: overriding javascript

2009-01-03 Thread Charley Baker
Execscript exists on the window object, drop the body call from your code and it should work: http://msdn.microsoft.com/en-us/library/ms536420(VS.85).aspx Charley Baker blog: http://charleybakersblog.blogspot.com/ Project Manager, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On