See the link:
https://groups.google.com/forum/?hl=en&fromgroups#!searchin/watir-general/read$20excel/watir-general/u077D-h7oIU/qAI2OpcecL8J
Search this groups archive for much info on this very topic.
On Tuesday, July 31, 2012 2:12:45 PM UTC-5, mc060200778 wrote:
> Hi,
>
> I tried to execute the following code but getting an error "*NoMethodError:
> unknown property or method: `length' HRESULT error code:0x80020006*"
>
> require "watir"
> require "test/unit"
> require "win32ole"
>
> class TC_Login < Test::Unit::TestCase
> $ie = Watir::IE.new
>
> def setup
> $ie.goto("http://gmail.com")
> end
>
> def test_login
> excel= WIN32OLE::new("excel.Application")
> wrkbook=excel.Workbooks.Open("C:\\gmail.xls")
> wrksheet = wrkbook.worksheets(1)
> wrksheet.select
> $username=wrksheet.cells(1,1)
> $password=wrksheet.cells(2,1)
> $ie.text_field(:id,"Email").set($username)
> $ie.text_field(:id,"Passwd").set($password)
> $ie.button(:name, 'signIn' ).click
> end
> end
>
> *
> *
> *Error Details:*
> test_login(TC_Login):
> NoMethodError: unknown property or method: `length'
> HRESULT error code:0x80020006
> Unknown name.
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classi
> put_elements.rb:363:in `method_missing'
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classi
> put_elements.rb:363:in `limit_to_maxlength'
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classi
> put_elements.rb:336:in `type_by_character'
> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classi
> put_elements.rb:299:in `set'
> delete.rb:16:in `test_login'
>
> What is wrong in the code? Please can someone explain
> Thanks
>
>
>
>
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]