[wtr-general] Re: Help with Modal Dialog boxes !!!!

2010-02-12 Thread GJHmf
@ Rohan

I had cause to revisit this issue after this afternoon suddently
having a similar modal window problem, and realise now what you were
on about and me telling you irrelevant info.  My solution was
naturally for attaching to browser windows spawned from a modal,
whereas your issue is for attaching to modals themselves.

I spotted this via the WATiR tutorial pages, and solved my modal
attachment woes (http://jira.openqa.org/browse/WTR-414).  It says its
an IE8 problem, but I experienced it on IE7.  I edited the
modal_dialog.rb file in my gems from 'Web Page Dialog' to 'Webpage
Dialog' and I could then interrogate the modal using the title.

I hope this helps you some more.


GJHmf

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


[wtr-general] Re: Help with Modal Dialog boxes !!!!

2010-02-10 Thread chandu.tennety
I noticed that your Watir version is 1.5.2. I'm not sure how well
modal dialogs were supported in that version. I would upgrade and try
some of Charley's solutions.

Chandu

On Feb 10, 12:40 am, Rohan Premvallabh Ojha 
wrote:
> HI Charley,
>
> I had tried the method that you have specified and re-tried it after your 
> post again.
>
> This is the message that comes up when I try to use it :
>
> >ruby nn.rb
>
> c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2775:in `initialize': 
> IE#modal_dialog not supported with the current version of Ruby (1.8.6). 
> (NoMethodError)
> Seehttp://jira.openqa.org/browse/WTR-2for details.
> undefined method `connect_unknown' for WIN32OLE:Class        from 
> c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:335:in `new'
>           from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:335:in 
> `modal_dialog'
>           from nn.rb:12
>
> >Exit code: 1
>
> So if you have this the connect_unknown' method for your Win32Ole ,can you 
> please share it with us as well.. I know there's a little bit of tweak 
> required with the connect method but still if you can share it would be 
> brilliant.
>
> Thanks
> Rohan Ojha
>
> 
> From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] 
> On Behalf Of Charley Baker
> Sent: Tuesday, February 09, 2010 9:22 PM
> To: watir-general@googlegroups.com
> Subject: Re: [wtr-general] Help with Modal Dialog boxes 
>
> It's a modal dialog alright.
>
> puts ie.modal_dialog.html
> puts ie.modal_dialog.title
>
> etc etc
>
> Works fine for us with latest Watir and Ruby 186. I've made sure that it does 
> work for each revision of Watir, including recompiling our custom win32ole.so 
> since we have apps that use it fairly extensively - up to 8 modals deep at 
> times. :\
>
> -Charley
> Lead Developer, Watir
>
> On Tue, Feb 9, 2010 at 5:49 AM, Željko Filipin 
> mailto:zeljko.fili...@wa-research.ch>> wrote:
> On Tue, Feb 9, 2010 at 1:46 PM, Rohan Premvallabh Ojha 
> mailto:rohan.o...@bsil.com>> wrote:> Also the title of 
> the window just gives it awaydoesn't it ?
>
> Pop ups are black magic for me. I have been lucky so far and never had to 
> deal with them, except for file uploads which work just fine.
>
> Ž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 
> 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


[wtr-general] Re: Help with Modal Dialog boxes !!!!

2010-02-09 Thread jw
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  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 
> 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


[wtr-general] Re: Help with Modal Dialog boxes !!!!

2010-02-08 Thread GJHmf
Hi,

I had this issue, and was partially what got me to migrate to Watir
from Selenium.  Assuming yours is the same setup as mine, I merely
attached to the open window like any other browser window using the
title.

e.g:  browser = Watir::IE.attach(:title, "Google")

I could then access any elements as normal as I would in the main
browser.

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