opps forgot to attach file :( On Thu, Apr 9, 2009 at 12:18 PM, spike <vinaykumarl...@gmail.com> wrote:
> > I'm really sorry, i've tried many things in the code but couldn get a > solution from past 3 days. I've stuck in handling this popups. so > please dont mind, i apologise for it. > > On Apr 9, 11:14 am, George <george.sand...@gmail.com> wrote: > > What about this neat little script? > > > > ie = Watir::IE.attach(/Watir General/) > > ie.text_field(:name, "q").set "popups" > > ie.button(:name, "qt_g").click > > > > Seriously, though...part of the learning process is doing the > > research. You can't expect that an entirely new set of Watir users > > are going to magically appear just because you started a duplicate > > thread in the same day. I've been finding that the "trial and error" > > approach to solving my scripting problems helps me develop more. You > > really shouldn't take advantage of people who are really trying to > > help you. > > > > On Apr 8, 10:55 pm, spike <vinaykumarl...@gmail.com> wrote: > > > > > > > > > ya but the solutions are not working for me. > > > > > On Apr 9, 10:35 am, George <george.sand...@gmail.com> wrote: > > > > > > Didn't you just make a thread about this? > > > > > > On Apr 8, 9:23 pm, spike <vinaykumarl...@gmail.com> wrote: > > > > > > > Hi > > > > > > > Can somebody please help me with handling popups using Watir i'm > stuck > > > > > with this. I tried many suggestions but it didnt help me. > > > > > > > I'm working on Windows XP and Internet Explorer 7. > > > > > somebody suggested me to install autoIt for handling popups so i've > > > > > installed autoIT-v3 also. > > > > > > > please please.. help me to handle popups like file download and > > > > > javascript > > > > > > > thankingyou- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text - > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
class Watir::Element # If any parent element isn't visible then we cannot write to the # element. The only realiable way to determine this is to iterate # up the DOM element tree checking every element to make sure it's # visible. def visible? # Now iterate up the DOM element tree and return false if any # parent element isn't visible or is disabled. object = document while object begin if object.currentstyle.invoke('visibility') =~ /^hidden$/i return false end if object.currentstyle.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end def top_edge assert_exists assert_enabled ole_object.getBoundingClientRect.top.to_i end def top_edge_absolute top_edge + page_container.document.parentWindow.screenTop.to_i end def left_edge assert_exists assert_enabled ole_object.getBoundingClientRect.left.to_i end def left_edge_absolute left_edge + page_container.document.parentWindow.screenLeft.to_i end def mouse_hover(offsetX = 0, offsetY = 0) x = left_edge_absolute + offsetX y = top_edge_absolute + offsetY WindowsInput.move_mouse(x, y) end def mouse_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x, y) Watir.autoit.MouseClick("left", x+offsetX, y+offsetY, 1) sleep(2) end def right_click(offsetX = 0, offsetY = 0) x = left_edge_absolute y = top_edge_absolute WindowsInput.move_mouse(x+offsetX, y+offsetY) WindowsInput.right_click end end