From dave.hoover at gmail.com Thu Aug 7 01:55:59 2008 From: dave.hoover at gmail.com (Dave Hoover) Date: Thu, 7 Aug 2008 01:55:59 -0400 Subject: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? In-Reply-To: References: Message-ID: <11c8704e0808062255u1b54f0daj11a16bcf0a8de90d@mail.gmail.com> Ben, Try something like... browser.alert.click Best, Dave Hoover //obtiva: Agility applied. Software delivered. On Tue, Jul 29, 2008 at 6:22 PM, Tremblay, Benjamin P. (Ben) wrote: > Hello scripters, > > I am very new to Ruby. And AppleScript is so old, it's new too. > > I'm looking at the colbert script in safariwatir_script.rb. The message page > on Colbert's site now pops up a JavaScript alert. > If I tell SafariWatir to click a button that submits a form that immediately > runs an onsubmit handler and immediately pops up an alert, HOW DO I DISMISS > THIS? > > The Ruby script looks blocked while it waits for the appscript module to > return. > > Could I spawn a Thread in Ruby to manage appscript, and then monitor it from > another thread? > > Any thoughts would be swell. > > Thanks. > > Ben > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general From bptremblay at avaya.com Thu Aug 7 08:56:29 2008 From: bptremblay at avaya.com (Tremblay, Benjamin P. (Ben)) Date: Thu, 7 Aug 2008 06:56:29 -0600 Subject: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? References: <11c8704e0808062255u1b54f0daj11a16bcf0a8de90d@mail.gmail.com> Message-ID: Dave, Thanks for writing back. Problem is that the script is _frozen_ until the alert is dismissed. The alert is blocking the ruby execution. I had to create my own appscript method that uses the "with timeout" parameter. This got me out of trouble. I will send more info when I have a bit more time. Ben -----Original Message----- From: Dave Hoover [mailto:dave.hoover at gmail.com] Sent: Wed 8/6/2008 11:55 PM To: Tremblay, Benjamin P. (Ben) Cc: safariwatir-general at rubyforge.org Subject: Re: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? Ben, Try something like... browser.alert.click Best, Dave Hoover //obtiva: Agility applied. Software delivered. On Tue, Jul 29, 2008 at 6:22 PM, Tremblay, Benjamin P. (Ben) wrote: > Hello scripters, > > I am very new to Ruby. And AppleScript is so old, it's new too. > > I'm looking at the colbert script in safariwatir_script.rb. The message page > on Colbert's site now pops up a JavaScript alert. > If I tell SafariWatir to click a button that submits a form that immediately > runs an onsubmit handler and immediately pops up an alert, HOW DO I DISMISS > THIS? > > The Ruby script looks blocked while it waits for the appscript module to > return. > > Could I spawn a Thread in Ruby to manage appscript, and then monitor it from > another thread? > > Any thoughts would be swell. > > Thanks. > > Ben > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general -------------- next part -------------- An HTML attachment was scrubbed... URL: From kcampos at bioiq.com Thu Aug 7 10:26:09 2008 From: kcampos at bioiq.com (Kyle Campos) Date: Thu, 7 Aug 2008 07:26:09 -0700 Subject: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? In-Reply-To: References: <11c8704e0808062255u1b54f0daj11a16bcf0a8de90d@mail.gmail.com> Message-ID: Tremblay, I'd like to see what you've done so please do send along when you have a chance. Thanks -Kyle On Aug 7, 2008, at 5:56 AM, Tremblay, Benjamin P. (Ben) wrote: > Dave, > > Thanks for writing back. > > Problem is that the script is _frozen_ until the alert is dismissed. > The alert is blocking the ruby execution. > > I had to create my own appscript method that uses the "with timeout" > parameter. This got me out of trouble. > > I will send more info when I have a bit more time. > > Ben > > > -----Original Message----- > From: Dave Hoover [mailto:dave.hoover at gmail.com] > Sent: Wed 8/6/2008 11:55 PM > To: Tremblay, Benjamin P. (Ben) > Cc: safariwatir-general at rubyforge.org > Subject: Re: [SafariWatir-general] How to dismiss a dialog when ruby > thread is blocked by AppleScript? > > Ben, > > Try something like... > > browser.alert.click > > Best, > > Dave Hoover > //obtiva: Agility applied. Software delivered. > > > > On Tue, Jul 29, 2008 at 6:22 PM, Tremblay, Benjamin P. (Ben) > wrote: > > Hello scripters, > > > > I am very new to Ruby. And AppleScript is so old, it's new too. > > > > I'm looking at the colbert script in safariwatir_script.rb. The > message page > > on Colbert's site now pops up a JavaScript alert. > > If I tell SafariWatir to click a button that submits a form that > immediately > > runs an onsubmit handler and immediately pops up an alert, HOW DO > I DISMISS > > THIS? > > > > The Ruby script looks blocked while it waits for the appscript > module to > > return. > > > > Could I spawn a Thread in Ruby to manage appscript, and then > monitor it from > > another thread? > > > > Any thoughts would be swell. > > > > Thanks. > > > > Ben > > _______________________________________________ > > SafariWatir-general mailing list > > SafariWatir-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/safariwatir-general > > > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general -------------- next part -------------- An HTML attachment was scrubbed... URL: From bptremblay at avaya.com Thu Aug 7 10:27:16 2008 From: bptremblay at avaya.com (Tremblay, Benjamin P. (Ben)) Date: Thu, 7 Aug 2008 08:27:16 -0600 Subject: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? In-Reply-To: References: <11c8704e0808062255u1b54f0daj11a16bcf0a8de90d@mail.gmail.com> Message-ID: def eval_js_with_timeout(script, seconds) @app.do_JavaScript(js.wrap(script), :in => @document, :timeout => seconds, :wait_reply => false) end ________________________________ From: Kyle Campos [mailto:kcampos at bioiq.com] Sent: Thursday, August 07, 2008 8:26 AM To: Tremblay, Benjamin P. (Ben) Cc: Dave Hoover; safariwatir-general at rubyforge.org Subject: Re: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? Tremblay, I'd like to see what you've done so please do send along when you have a chance. Thanks -Kyle On Aug 7, 2008, at 5:56 AM, Tremblay, Benjamin P. (Ben) wrote: Dave, Thanks for writing back. Problem is that the script is _frozen_ until the alert is dismissed. The alert is blocking the ruby execution. I had to create my own appscript method that uses the "with timeout" parameter. This got me out of trouble. I will send more info when I have a bit more time. Ben -----Original Message----- From: Dave Hoover [mailto:dave.hoover at gmail.com] Sent: Wed 8/6/2008 11:55 PM To: Tremblay, Benjamin P. (Ben) Cc: safariwatir-general at rubyforge.org Subject: Re: [SafariWatir-general] How to dismiss a dialog when ruby thread is blocked by AppleScript? Ben, Try something like... browser.alert.click Best, Dave Hoover //obtiva: Agility applied. Software delivered. On Tue, Jul 29, 2008 at 6:22 PM, Tremblay, Benjamin P. (Ben) wrote: > Hello scripters, > > I am very new to Ruby. And AppleScript is so old, it's new too. > > I'm looking at the colbert script in safariwatir_script.rb. The message page > on Colbert's site now pops up a JavaScript alert. > If I tell SafariWatir to click a button that submits a form that immediately > runs an onsubmit handler and immediately pops up an alert, HOW DO I DISMISS > THIS? > > The Ruby script looks blocked while it waits for the appscript module to > return. > > Could I spawn a Thread in Ruby to manage appscript, and then monitor it from > another thread? > > Any thoughts would be swell. > > Thanks. > > Ben > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general _______________________________________________ SafariWatir-general mailing list SafariWatir-general at rubyforge.org http://rubyforge.org/mailman/listinfo/safariwatir-general -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at newmedio.com Mon Aug 11 13:08:28 2008 From: brian at newmedio.com (Brian Dunn) Date: Mon, 11 Aug 2008 12:08:28 -0500 Subject: [SafariWatir-general] how do i access a link? Message-ID: <367444F9-110A-4270-A656-2C98FE5039C0@newmedio.com> I've tried both :class and :xpath "hows" on Watir::Safari#link and both give exceptions like this one. NoMethodError: undefined method `operate_by_xpath' for # /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./ safariwatir.rb:74:in `send' /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./ safariwatir.rb:74:in `operate' /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./ safariwatir/scripter.rb:152:in `highlight' /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./ safariwatir.rb:184:in `click' how can i get me a link object that i might click upon it? From oliver.saunders at gmail.com Thu Aug 14 14:33:26 2008 From: oliver.saunders at gmail.com (Ollie Saunders) Date: Thu, 14 Aug 2008 14:33:26 -0400 Subject: [SafariWatir-general] HTML method only returns body Message-ID: <13d820710808141133w5db66329ke0ef06494ee58d75@mail.gmail.com> Hi there I've recently discovered Watir and SafariWatir and I think they are awesome. Get work guys! Here's the problem I'm having. I've got a page with this content: Ontario Ontario is awesome and yet when I run this: Watir::Safari.new.html I get: "\n Ontario is awesome\n \n\n" I would like to inspect the contents of the title element. Is there any way to do this? It seems to me a method called html should give me the entire html document. As it is the html should probably be renamed to body. Many thanks, Ollie From dave.hoover at gmail.com Sun Aug 17 18:09:25 2008 From: dave.hoover at gmail.com (Dave Hoover) Date: Sun, 17 Aug 2008 17:09:25 -0500 Subject: [SafariWatir-general] how do i access a link? In-Reply-To: <367444F9-110A-4270-A656-2C98FE5039C0@newmedio.com> References: <367444F9-110A-4270-A656-2C98FE5039C0@newmedio.com> Message-ID: <11c8704e0808171509q121d4648o70659fa4209f7ce1@mail.gmail.com> Brian, Can you provide the source code that's failing for you? Thanks, --Dave On Mon, Aug 11, 2008 at 12:08 PM, Brian Dunn wrote: > I've tried both :class and :xpath "hows" on Watir::Safari#link and both give > exceptions like this one. > > NoMethodError: undefined method `operate_by_xpath' for > # > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir.rb:74:in > `send' > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir.rb:74:in > `operate' > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir/scripter.rb:152:in > `highlight' > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir.rb:184:in > `click' > > how can i get me a link object that i might click upon it? > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general From dave.hoover at gmail.com Sun Aug 17 19:43:26 2008 From: dave.hoover at gmail.com (Dave Hoover) Date: Sun, 17 Aug 2008 18:43:26 -0500 Subject: [SafariWatir-general] HTML method only returns body In-Reply-To: <13d820710808141133w5db66329ke0ef06494ee58d75@mail.gmail.com> References: <13d820710808141133w5db66329ke0ef06494ee58d75@mail.gmail.com> Message-ID: <11c8704e0808171643l1b21bdd5w74685aa8c5808961@mail.gmail.com> Ollie, I've implemented 2 solutions for you. The html method now returns all of the html. And I've also added a title method. The gem should be available in the next few hours. Enjoy! --Dave On Thu, Aug 14, 2008 at 1:33 PM, Ollie Saunders wrote: > Hi there > > I've recently discovered Watir and SafariWatir and I think they are > awesome. Get work guys! > > Here's the problem I'm having. I've got a page with this content: > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > Ontario > > > Ontario is awesome > > > > and yet when I run this: > > Watir::Safari.new.html > > I get: > > "\n Ontario is awesome\n \n\n" > > I would like to inspect the contents of the title element. Is there > any way to do this? > It seems to me a method called html should give me the entire html > document. As it is the html should probably be renamed to body. > > Many thanks, > > Ollie > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general From dave.hoover at gmail.com Sun Aug 17 20:14:46 2008 From: dave.hoover at gmail.com (Dave Hoover) Date: Sun, 17 Aug 2008 19:14:46 -0500 Subject: [SafariWatir-general] how do i access a link? In-Reply-To: <367444F9-110A-4270-A656-2C98FE5039C0@newmedio.com> References: <367444F9-110A-4270-A656-2C98FE5039C0@newmedio.com> Message-ID: <11c8704e0808171714p54d7a3a8x5843e605e45adcaf@mail.gmail.com> I just released SafariWatir 0.2.8, which will allow you to look up elements by class name. Give it a try. :) On Mon, Aug 11, 2008 at 12:08 PM, Brian Dunn wrote: > I've tried both :class and :xpath "hows" on Watir::Safari#link and both give > exceptions like this one. > > NoMethodError: undefined method `operate_by_xpath' for > # > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir.rb:74:in > `send' > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir.rb:74:in > `operate' > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir/scripter.rb:152:in > `highlight' > > /opt/local/lib/ruby/gems/1.8/gems/safariwatir-0.2.6/./safariwatir.rb:184:in > `click' > > how can i get me a link object that i might click upon it? > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general From aidy.lewis at googlemail.com Wed Aug 27 12:06:09 2008 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 27 Aug 2008 17:06:09 +0100 Subject: [SafariWatir-general] [SafariWatir] watir aggregation Message-ID: <7ac2300c0808270906l8e68bddr7e613e314c9e88ca@mail.gmail.com> Dave et al, You may be aware that there is currently undergoing a merge between Watir and FireWatir. One of the consequences of this is a FireWatir and Watir email list merge. Would you also consider bringing your list to the fold? Many users of Watir are also using FireWatir and I for one will be also using SafariWatir in the near future. Aidy From dave at obtiva.com Wed Aug 27 17:38:44 2008 From: dave at obtiva.com (Dave Hoover) Date: Wed, 27 Aug 2008 16:38:44 -0500 Subject: [SafariWatir-general] [SafariWatir] watir aggregation In-Reply-To: <7ac2300c0808270906l8e68bddr7e613e314c9e88ca@mail.gmail.com> References: <7ac2300c0808270906l8e68bddr7e613e314c9e88ca@mail.gmail.com> Message-ID: <11c8704e0808271438t417e75c2j108fbfb1d261df48@mail.gmail.com> I don't have any problem with merging lists, as long as everyone understands that most SafariWatir emails are error reports and/or feature requests. I look forward to the day when we can merge more than just lists. :) Dave Hoover //obtiva: Agility applied. Software delivered. On Wed, Aug 27, 2008 at 11:06 AM, aidy lewis wrote: > Dave et al, > > You may be aware that there is currently undergoing a merge between > Watir and FireWatir. > > One of the consequences of this is a FireWatir and Watir email list merge. > > Would you also consider bringing your list to the fold? > > Many users of Watir are also using FireWatir and I for one will be > also using SafariWatir in the near future. > > Aidy > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general > From zeljko.filipin at gmail.com Sat Aug 30 04:50:00 2008 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 30 Aug 2008 10:50:00 +0200 Subject: [SafariWatir-general] [SafariWatir] watir aggregation In-Reply-To: <11c8704e0808271438t417e75c2j108fbfb1d261df48@mail.gmail.com> References: <7ac2300c0808270906l8e68bddr7e613e314c9e88ca@mail.gmail.com> <11c8704e0808271438t417e75c2j108fbfb1d261df48@mail.gmail.com> Message-ID: On Wed, Aug 27, 2008 at 11:38 PM, Dave Hoover wrote: > I look forward to the day when we can merge more than just lists. :) +1 ?eljko -- WatirPodcast.com/5 -------------- next part -------------- An HTML attachment was scrubbed... URL: