[wtr-general] Re: Checking form controls/fields using a hash

2009-05-12 Thread George
Hi everybody, I figured I should close out this thread with a good (well, I guess that's relative) solution to my problem: company_name = $ie.text_field(:id, CompanyName) username = $ie.text_field(:id, username) password = $ie.text_field(:id, password) page_hash = {company_name = Company Name

[wtr-general] Re: Checking form controls/fields using a hash

2009-04-03 Thread George
This is what I tried initially (see my first post). Hashes do not allow the exists? method, and it looks like has_key? only checks the key in the hash (not the actual text field on the webpage). Any other ideas? :) On Apr 2, 8:23 pm, Paul Rogers paul.rog...@shaw.ca wrote: I think ( i didnt

[wtr-general] Re: Checking form controls/fields using a hash

2009-04-03 Thread Paul Rogers
your keys are the methods, so this might be what you need contact_controls.each do |k,v| if eval(k).exists? puts its there else puts oh no end end On Fri, Apr 3, 2009 at 8:06 AM, George george.sand...@gmail.com wrote: This is what I tried initially (see my first

[wtr-general] Re: Checking form controls/fields using a hash

2009-04-02 Thread George
Thanks, Paul! For those who are interested, this part of the code worked for me: contact_controls.each do |key, value| if contact_controls.has_key?(key) puts PASS: Control #{value} exists. else puts FAIL: Unable to locate control #{value} end end I thought I

[wtr-general] Re: Checking form controls/fields using a hash

2009-04-02 Thread Paul Rogers
I think ( i didnt look too hard ) that it will only see if the key is there, this might be what you want contact_controls.each do |k,v| if k.exists? puts its there else puts oh no end end Pau On Thu, Apr 2, 2009 at 7:58 PM, George george.sand...@gmail.com wrote: Thanks,