[Wtr-general] Long, strange field name issue

2007-05-22 Thread Tiffany Fodor
Hi all!

I'm using the new Excel interface class to retrieve data from a spreadsheet for 
testing our web app.  One field on our website is giving me fits.  

I've verified with IE Developer that the field is Business Income/Extra 
Expense/Rental Value_0

The line in my script (#126) that writes data to this field looks like this:

 ie.text_field(:name, Business Income/Extra Expense/Rental 
Value_0).set(account[bldgBI])

When my script gets to this point, I get the following error:

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4054:in 
`doKeyPress': undefined method `length' for nil:NilClass (NoMethodError)
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4026:in `set'
from C:/WatirScripts/CreateQuotes.rb:126
from C:/WatirScripts/CreateQuotes.rb:76:in `each'
from C:/WatirScripts/CreateQuotes.rb:76

Does anyone know if my problem is the length of the field name or if it's 
because it includes /'s?  Is there any way around the problem?

Thanks in advance for any help you can provide!

-Tiffany
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Long, strange field name issue

2007-05-22 Thread Paul Carvalho

Did you try it with single-quotes instead of double-quotes?


On 22/05/07, Tiffany Fodor [EMAIL PROTECTED] wrote:


The line in my script (#126) that writes data to this field looks like
this:

ie.text_field(:name, Business Income/Extra Expense/Rental
Value_0).set(account[bldgBI])


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Long, strange field name issue

2007-05-22 Thread Tiffany Fodor
Thanks so much for the suggestion and quick resonse, but  I tried single quotes 
and got the same error.  

I've also tried finding the object using :class (not great since I may have 
multiple fields with the same class) and :title.  When I used :class, I got the 
same error as before.  When I used :title I got an error saying it was unable 
to locate the object.

-Tiffany
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Long, strange field name issue

2007-05-22 Thread Paul Rogers

the exception is caused by the value you are trying to set
account[bldgBI] being nil
you can test is by doing this first

puts oh no - its nil  if account[bldgBI].nil?



- Original Message -
From: Tiffany Fodor [EMAIL PROTECTED]
Date: Tuesday, May 22, 2007 11:04 am
Subject: [Wtr-general] Long, strange field name issue

 Hi all!
 
 I'm using the new Excel interface class to retrieve data from a 
 spreadsheet for testing our web app.  One field on our website is 
 giving me fits.  
 
 I've verified with IE Developer that the field is Business 
 Income/Extra Expense/Rental Value_0
 
 The line in my script (#126) that writes data to this field looks 
 like this:
 
 ie.text_field(:name, Business Income/Extra Expense/Rental 
 Value_0).set(account[bldgBI])
 When my script gets to this point, I get the following error:
 
 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:4054:in 
 `doKeyPress': undefined method `length' for nil:NilClass 
 (NoMethodError)from c:/ruby/lib/ruby/gems/1.8/gems/watir-
 1.5.1.1166/./watir.rb:4026:in `set'
from C:/WatirScripts/CreateQuotes.rb:126
from C:/WatirScripts/CreateQuotes.rb:76:in `each'
from C:/WatirScripts/CreateQuotes.rb:76
 
 Does anyone know if my problem is the length of the field name or 
 if it's because it includes /'s?  Is there any way around the problem?
 
 Thanks in advance for any help you can provide!
 
 -Tiffany
 ___
 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] Long, strange field name issue

2007-05-22 Thread Tiffany Fodor
D'Oh!  I was so focused on that field name that I didn't notice I forgot to 
update my script with the new name of that row in my spreadsheet.  I was trying 
to enter a value that didn't exist in my hash.

It works fine now.  Thanks so much for your help and quick responses!

-Tiffany
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general