Hi Charley, Thanks for the advice but I am stilling having trouble overriding the js script.
require 'watir' ie = Watir::IE.new ie.goto("http://www.w3schools.com/JS/tryit.asp?filename=tryjs_confirm") ie.document.parentWindow.execScript("'disp_confirm=function{return true;}', 'JavaScript'") ie.frame(:name, "view").button(:value, "Display a confirm box").click_no_wait Aidy 2009/1/3 Charley Baker <charley.ba...@gmail.com>: > 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 Sat, Jan 3, 2009 at 1:05 PM, aidy lewis <aidy.le...@googlemail.com> > wrote: >> >> Hi, >> >> I am trying to override js to bypass a js dialog: >> >> This is what I have got: >> >> require 'watir' >> >> ie = Watir::IE.new >> ie.goto("http://www.w3schools.com/JS/tryit.asp?filename=tryjs_confirm") >> #ie.frame(:name, "view").button(:value, "Display a confirm box").click >> >> ie.document.body.parentElement.execScript("window.confirm=function(){return >> true;}") >> >> I am getting unknown property or method `execScript' >> >> Could anyone please direct me? >> >> Aidy >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---