By "having the access right" do you mean access as in "permissions" or
just you're not accessing it correctly?

I have been using enabled_popup and WinClicker to interact with
javascript modal dialogs with decent success.
The button I had to click was labelled "Open" but the button name I
had to pass to WinClicker was "&Open"

I don't know if this is a convention or if it's just in my app.  I
found this out by

ie = attach (...)
# manually click the button to create the modal
hwnd = ie.enabled_popup(3)
w = WinClicker.new
w.get_static_text_hwnd(hwnd)
=> ["Look &in:", "", "File &name:", "Files of &type:"]
w.clickWindowsButton_hwnd(hwnd, 'Open')
=> false
w.clickWindowsButton_hwnd(hwnd, '&Open')
=> true


if you do a
puts w.methods
you'll see the methods like
get_static_text_hwnd
get_win_title
getStaticText
getStaticText_hWnd
get_static_text_hwnd
that you can try using to figure out what the button is actually
called.

hopefully i'm not just telling you stuff you already know/have
tried...



On Feb 9, 6:25 am, Rohan Premvallabh Ojha <rohan.o...@bsil.com> wrote:
> Hi,
>
> Thanks for the information/URL but I am still unable to move ahead with the 
> modal dialogs.
>
> What I have tried so far is:
>
> Method I:
>
> Used all the methods in the watir.rb file for Class ModalDialog but they 
> don't seem to work with Ruby ver 1.8.6 or 1.8.5 for that matter.
> So I had Ruby 1.8.2 installed in another machine but that doesn't seem to 
> support "click_no_wait".
>
> mod= ModalDialog.new
> mod.find_modal_from_window
>
> Method II :
>
> Tried using the modal dialog example from the Wiki page
>
>  modal = ie.modal_dialog(:title,'Modal Dialog - Webpage Dialog')
>  puts modal.title()
>  modal.wait
>  puts modal.button(:index,1)
>
> Method III :
>
> Tried finding the connect_unknown method in Win32Ole.
>
> We encounter NoMethodError for connect_unknown in the locate method for the 
> class ModalDialog. However win32ole doesn't have any method by such name.The 
> method present is connect which takes argument as either OLE program id or 
> class id or moniker.
>
> Method IV :
>
> Winclicker
>
> Tried using the winclicker class of watir to handle the modal dialog.
>
> w=WinClicker.new
> q1=w.getWindowHandle(/Webpage Dialog/)
> puts q1                                               (This returns to me the 
> hwnD for the modal dialog box)
> puts w.getWindowTitle(q1)                      (This returns to me the title 
> of the modal dialog window)
>
> However if we try to use :
> w.clickWindowsButton_hwnd(q1,'Run')                 (Run is the caption of 
> the button that I need to click)
>
> The system returns me FALSE so even though we have control of the modal 
> dialog we still don't have the access right to the window.
>
> Also it seems to me that as we have moved ahead with newer versions of Ruby 
> and Watir we seemed to have gone backwards with respect to pop-ups (modal or 
> non-modal)
>
> So can you guys please look into it so that we can get going with not just  
> this but with other such problems in Watir
>
> ________________________________
> From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] 
> On Behalf Of Željko Filipin
> Sent: Monday, February 08, 2010 6:07 PM
> To: watir-general@googlegroups.com
> Subject: Re: [wtr-general] Help with Modal Dialog boxes !!!!
>
> On Mon, Feb 8, 2010 at 7:03 AM, Rohan Ojha 
> <rohan.o...@bsil.com<mailto:rohan.o...@bsil.com>> wrote:
> > Has anybody come across some method with which we can work on a modal 
> > dialog window.
>
> Thanks for the screen shot, it always helps.
>
> Did you read this?
>
> http://wiki.openqa.org/display/WTR/Pop+Upshttp://wiki.openqa.org/display/WTR/Modal+Dialogshttp://wiki.openqa.org/display/WTR/New+Browser+Windows
>
> Željko
> --
> 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 
> athttp://groups.google.com/group/watir-general

-- 
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