RE: [wtr-general] method_missing due to bad html?

2009-12-10 Thread Jason Trebilcock
Tom, If you try to execute each line of your script through irb, what kind of results are you seeing? I was able to execute your script without issue on my machine here (Windows 7, Ruby 1.8.6, Watir 1.6.5). Part of me is wondering if what you're running into is some sort of permissions issue. He

[wtr-general] method_missing due to bad html?

2009-12-10 Thread Tom
Sorry if this is a repeat, but I did search for this issue and didn't find it. I'm a novice at both Ruby and Watir, as well. I have a very simple script (part of a much larger script that I'm trying to resurrect): require "watir" browser = Watir::Browser.new browser.goto("http://202.36.68.44/";)

[wtr-general] Re: Support Sheriff

2009-12-10 Thread Tiffany Fodor
Thanks to Željko and the rest of the Watir team for your confidence in me. I'm honored to be counted among such a great group of people. I'll do my best not to let it go to my head. ;-) -Tiffany On Dec 10, 3:50 pm, Željko Filipin wrote: > Watir team had a little chat and we decided it would

[wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread bender25
Agreed. Thanks so much for all help in this matter - to everyone. On Dec 11, 9:44 am, Željko Filipin wrote: > On Thu, Dec 10, 2009 at 11:34 PM, bender25 wrote: > > I guess it comes down to which one provides the best efficiency? > > I doubt you would see any significant difference if you benchm

[wtr-general] Support Sheriff

2009-12-10 Thread Željko Filipin
Watir team had a little chat and we decided it would be a good idea to grow. I am glad I can announce that Tiffany Fodor and Wesley Chen have accepted to be added to Watir community team with title of Support Sheriff: http://watir.com/team/ Tiffany answers a lot of questions and Wesley is helpin

Re: [wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 11:34 PM, bender25 wrote: > I guess it comes down to which one provides the best efficiency? I doubt you would see any significant difference if you benchmark both methods (but I could be wrong). I prefer Ethan's code, there is just less code there. There's no code like n

RE: [wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread Alan Baird
> Do you know how to keep these nil entries out of the image collection? expand_images.compact (assuming expand_images is an array) This email message and any attachments are for the sole use of the intended recipients and may contain proprietary and/or confidential information which may be pri

RE: [wtr-general] Re: better way to do a conditional require

2009-12-10 Thread Alan Baird
Thanks all for the responses. I like the rescue nil trick, never thought of that. Alan -Original Message- From: watir-general+ow...@googlegroups.com [mailto:watir-general+ow...@googlegroups.com] On Behalf Of b...@pettichord.com Sent: Tuesday, December 08, 2009 6:35 PM To: Watir General

[wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread bender25
Ethan and Željko, Both of your methods have worked for me. I guess it comes down to which one provides the best efficiency? On Dec 11, 9:10 am, Ethan wrote: > element collections extend Enumerable, don't they? > so > > expand_images = browser.images.select do |image| >   image.alt =~ /^expand/

Re: [wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread Ethan
element collections extend Enumerable, don't they? so expand_images = browser.images.select do |image| image.alt =~ /^expand/ end should work, and not have nils On Thu, Dec 10, 2009 at 17:07, Željko Filipin wrote: > On Thu, Dec 10, 2009 at 10:59 PM, bender25 wrote: > > Do you know how to ke

Re: [wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 10:59 PM, bender25 wrote: > Do you know how to keep these nil entries out of the image collection? expand_images_and_nils = browser.images.collect do |image| image if image.alt =~ /^expand/ end expand_images = expand_images_and_nils.compact More information: http://ww

[wtr-general] Re: How to create a function with an unknown number of variables

2009-12-10 Thread AR
That's great - thanks Bill! I picked up Everyday Scripting with Ruby a while back to supplement and see how other people were using it practically, but it wouldn't hurt to have O'Reilly on hand as well. Thanks again, Adam On Dec 10, 3:39 pm, Bill Agee wrote: > As for what it's called, various R

Re: [wtr-general] Re: Wătir

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 1:03 AM, Tiffany Fodor wrote: > Would it be possible to add an audio pronunciation like they do at > dictionary.com on watir.com? Done. Željko -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, sen

Re: [wtr-general] Re: Wătir

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 7:19 PM, Tiffany Fodor wrote: > If I'd read the entire thread more carefully, I would have noticed > that you had the same great idea: Until I catch Bret to say that, I will use the link you have provided. :) Željko -- You received this message because you are subscribe

[wtr-general] Re: Collection of images where specifiec field matches text pattern

2009-12-10 Thread bender25
Thanks Željko, This syntax did run fine, I did however notice a strange result. The image collection returned contains a nil entry per image on screen where the alt tag did not match the regular expression. This adds overhead to my iteration over the collection - by needing to check if the curre

Re: [wtr-general] How to create a function with an unknown number of variables

2009-12-10 Thread Bill Agee
As for what it's called, various Ruby guides use the name "variable-length argument lists". There's some good info online: http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Method_Calls#Variable_Length_Argument_List.2C_Asterisk_Operator http://ruby-doc.org/docs/ProgrammingRuby/html/tut_method

[wtr-general] How to create a function with an unknown number of variables

2009-12-10 Thread AR
Basic application: I currently have a function in almost every script that is screaming to be stripped out and put into a global helper.rb file. At the end of a series of tests, it sends me an email and parses the errors I've collected stored in the array $errors. This works well, except that som

Re: [wtr-general] How to easily get button index?

2009-12-10 Thread Paul Rogers
i think the each is done by including enumberable ( http://ruby-doc.org/core/classes/Enumerable.html) module ( it was way back anyway), so any methods in the enumberable module should just work: ie.buttons.each_with_index do |button, i| puts "index for bytton with id #{button.id} is #{ i + 1

[wtr-general] Re: Wătir

2009-12-10 Thread Tiffany Fodor
If I'd read the entire thread more carefully, I would have noticed that you had the same great idea: > Maybe we should record Bret saying something like this. :) > http://www.paul.sladen.org/pronunciation/ Sorry about that! :) -Tiffany On Dec 10, 3:39 am, Željko Filipin wrote: > On Thu, Dec

[wtr-general] Re: How to easily get button index?

2009-12-10 Thread jw
when poking around at the page, trying to find attributes of UI elements, it's incredibly useful to open your webpage, start irb, get a new Watir::IE using attach, then just play around with puts $ie.buttons[1] puts $ie.links[12] etc On Dec 9, 8:20 pm, Marlon wrote: > Hi, > > How can I easy get b

Re: [wtr-general] Re:how watir interacts with powerpoint if powerpoint is opened in the browser

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 3:17 PM, arihan sinha wrote: > now i need to validate that powerpoint which opened in the browser by checking the text/link on that. I do not think Watir can test powerpoint files opened in browser. It is probably using a browser plugin for that and Watir can not automate

[wtr-general] Re: different table of character between watir 1.6.2 and watir 1.6.5

2009-12-10 Thread Fabien
Hello Tiffany, Thanks you for your answer. In fact, that's work if i add the lines code in my program with ruby 1.6.5 require "win32ole" WIN32OLE.codepage = WIN32OLE::CP_ACP Best Regards, Fabien On 10 déc, 00:36, Tiffany Fodor wrote: > Hi Fabien! > > There was a change in 1.6.5 to use UTF-8

Re: [wtr-general] How to easily get button index?

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 3:20 AM, Marlon wrote: > How can I easy get button index? counter = 1 browser.buttons.each do |button| puts "index:#{counter}" puts button.to_s puts counter += 1 end Please let me know if you would like me to comment the code. Željko -- watir.com - commun

[wtr-general] watir.com/rdoc

2009-12-10 Thread Željko Filipin
I would like to put new rdoc at http://watir.com/rdoc How to generate new rdoc, since now we have three gems? Should I clone git://github.com/bret/watir.git and create rdoc from there or should I create separate rdoc for each gem? C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.5>rdoc C:\ruby\lib\ruby\

Re: [wtr-general] Re: Wătir

2009-12-10 Thread Željko Filipin
On Thu, Dec 10, 2009 at 1:03 AM, Tiffany Fodor wrote: > http://dictionary.reference.com/browse/water (see the speaker icon > next to the word 'water') Great idea. :) I will add it to the web site. Željko -- You received this message because you are subscribed to the Google Groups "Watir Gene

Re: [wtr-general] Error in installation of gem

2009-12-10 Thread Željko Filipin
On Wed, Dec 9, 2009 at 7:51 AM, chethan sarathy wrote: > Here is the solution for Ruby Installation & Updating the Gems. Chethan, Thank you for letting us know how to fix it. Željko -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to