Re: [Wtr-general] Selecting controls in a dialog box
A quick check will tell you if it's a modal dialog. Open ie to the page that launches the dialog. Open irb in a command window. In irb type: require 'watir' ie = Watir::IE.attach(:title, /some part of the ie title/) Launch the dialog. Back in irb type: puts ie.modal_dialog.title If you get a title string then you've got an ie modal dialog which you can interact with using ie.modal_dialog The tricky thing with modal dialogs is getting the controls. You can dump the html into a file, pop it open using ie and then use ie developer toolbar on it. -Charley On 7/10/07, Bret Pettichord [EMAIL PROTECTED] wrote: Paul Rogers wrote: have you looked at the modal_dialog stuff in watir? Ive never used it so cant help you much, but its there. +1 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
It seems like I am having troubles with Ruby v1.8.5 and the modal_dialog support. Should I roll back to 1.8.2-14? I was reading a post by Bret the other day saying that there may be issues with newer versions of Ruby. I am using: ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] watir 1.5.1.1192 irb(main):006:0* b.modal_dialog.title NoMethodError: IE#modal_dialog not supported with the current version of Ruby (1.8.5). See http://jira.openqa.org/browse/WTR-2 for details. undefined method `connect_unknown' for WIN32OLE:Class from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:28 27:in `initialize' from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:32 5:in `new' from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:32 5:in `modal_dialog' from (irb):6 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
yes, modal dialogs are only supported using that particular version - Original Message - From: Matt Berney [EMAIL PROTECTED] Date: Wednesday, July 11, 2007 11:09 am Subject: Re: [Wtr-general] Selecting controls in a dialog box To: wtr-general@rubyforge.org It seems like I am having troubles with Ruby v1.8.5 and the modal_dialog support. Should I roll back to 1.8.2- 14? I was reading a post by Bret the other day saying that there may be issues with newer versions of Ruby. I am using: ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] watir 1.5.1.1192 irb(main):006:0* b.modal_dialog.title NoMethodError: IE#modal_dialog not supported with the current version of Ruby (1.8.5). See http://jira.openqa.org/browse/WTR-2 for details. undefined method `connect_unknown' for WIN32OLE:Class from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:28 27:in `initialize' from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:32 5:in `new' from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:32 5:in `modal_dialog' from (irb):6 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
No way!!! It works!!! Uninstalling 1.8.5 and installing 1.8.2-15 worked like a champ!!! This required installing gem watir-1192 as well as installing gem win32-process. But other than that, it works just as advertised... ie = Watir::IE.attach(:url,/ticket.aspx/) ie.button(:name,button).click == opens modal dialog ie.modal_dialog.select_list(:id,comboBox).select(item) ie.modal_dialog.text_field(:id,text).set(Comments) ie.modal_dialog.button(:name,btnContinue).click Thanks again for all the help!!! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
Step 1: Since it is a dialog box, Attach the focus to this page by using the following: ie = Watir::IE.attach(:title, Web Page Dialog) Step 2: Do a puts ie.show_all_objects This will give the various objects and their identification attributes. Step 3: Based on the above output, perform the regular text field entry and click button operation. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
have you looked at the modal_dialog stuff in watir? Ive never used it so cant help you much, but its there. - Original Message - From: Matt Berney [EMAIL PROTECTED] Date: Tuesday, July 10, 2007 12:10 pm Subject: Re: [Wtr-general] Selecting controls in a dialog box To: wtr-general@rubyforge.org The default Watir::IE.attach method doesn't seem to work because this is a dialog. I can use the autoit.WinWait() method to get the window handle. But, access the controls on the dialog seems elusive. Any help is greatly appreciated. irb(main):005:0 d = Watir::IE.attach(:title,/Web Page Dialog/) Watir::Exception::NoMatchingWindowFoundException: Unable to locate a window with title of (?-mix:Web Page Dialog) from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:16 42:in `attach_browser_window' from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:15 19:in `_attach_init' from d:/tools/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:15 13:in `attach' from (irb):5 irb(main):018:0 autoit = WIN32OLE.new('AutoItX3.Control') = #WIN32OLE:0x9f0cb30 irb(main):019:0 autoit.WinWait Web Page Dialog, , 1 = 1 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
Paul Rogers wrote: have you looked at the modal_dialog stuff in watir? Ive never used it so cant help you much, but its there. +1 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Selecting controls in a dialog box
---BeginMessage--- this sounds like a modal dialog box Ive never used them, but there should be unit tests and its been mentioned on the list many times, so you should be able to search the archives for sample code Paul - Original Message - From: Matt Berney [EMAIL PROTECTED] Date: Monday, July 9, 2007 1:17 pm Subject: [Wtr-general] Selecting controls in a dialog box To: wtr-general@rubyforge.org When I click a button on the web page, it displays a dialog. Title: Web Page Dialog Controls: * one select list * one text field * two buttons (OK, Cancel) How do I access the dialog box? How do I select an item from the list? Do I use the Watir::IE.select_list.getAllItems() call? How do I enter data in the text field? How do I click on the buttons? Thanks in advance. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ---End Message--- ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general