Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread Walter Kruse
I suspect that your problem is in the path + filename definition. On
Windows I have always had to use / or \\ instead of the \ in defining
paths. I also advise not using directories with spaces in the names. You
may also under certain circumstances need to escape the . in .xls with a
\

HTH

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of murali
Sent: 10 July 2007 07:42 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] need help on Data Driven

Hi every one,

   iam facing problem with the data driven. have glance of my
code and let me know where i did mistake.

excel= WIN32OLE::new('excel.Application')
workbook=excel.Workbooks.Open('D:\Documents and
Settings\mmopur\Desktop\IPE Aut\test.xls')
worksheet=workbook.Worksheets(1)
worksheet.Select
excel ['Visible']
#worksheet.Range('a2') ['Value']
category=worksheet.Range('a2:a4') ['Value']
line = '1'
while worksheet.Range(a#{line})['Value']
   line.succ!
 
ie.text_field(:name,ctl00$ContentPlaceHolder1$txtCategory).set(categor
y)


when i run the script iam getting the errors as belo mentioned

c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `+': can't convert Array
into S
ring (TypeError)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in
`doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `each'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in
`doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3393:in `set'
from D:/Documents and Settings/mmopur/Desktop/IPE
Aut/datadriven.rb:59


plz look into that and do needful

Regards
Murali
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
**
Everything in this e-mail and attachments relating to the official business of 
MultiChoice Africa is proprietary to 
the company. Any view or opinion expressed in this message may be the view of 
the individual and should not automatically 
be ascribed to the company.  If you are not the intended recipient, you may not 
peruse, use, disseminate, distribute or 
copy this message. If you have received this message in error, please notify 
the sender immediately by email, facsimile 
or telephone and destroy the original message.
**
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread Lavanya Lakshman
Try the following 

Category is holding an array and not just  a single variable. Thereby each 
value needs to be picked up and then assigned. 

category.each do |cat|
ie.text_field(:name,ctl00$ContentPlaceHolder1$txtCategory).set(cat.to_s)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread murali
Thanks it is working fine.

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


Re: [Wtr-general] need help on Data Driven

2007-07-10 Thread Charley Baker

The error pretty much tells you the story. You're taking an array: category=
worksheet.Range('a2:a4') ['Value']  and pushing it into a method that
accepts a string. If you want the whole array to be a string then convert it
to a string:
category=worksheet.Range('a2:a4') ['Value']

category.to_s

If that's not the intention, then grab whatever string you want and pass
that on - cycle through the array, whatever.

-Charley

On 7/9/07, murali [EMAIL PROTECTED] wrote:


Hi every one,

   iam facing problem with the data driven. have glance of my code
and let me know where i did mistake.

excel= WIN32OLE::new('excel.Application')
workbook=excel.Workbooks.Open('D:\Documents and
Settings\mmopur\Desktop\IPE Aut\test.xls')
worksheet=workbook.Worksheets(1)
worksheet.Select
excel ['Visible']
#worksheet.Range('a2') ['Value']
category=worksheet.Range('a2:a4') ['Value']
line = '1'
while worksheet.Range(a#{line})['Value']
   line.succ!

ie.text_field(:name,ctl00$ContentPlaceHolder1$txtCategory).set(category)


when i run the script iam getting the errors as belo mentioned

c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `+': can't convert Array
into S
ring (TypeError)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `each'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3393:in `set'
from D:/Documents and Settings/mmopur/Desktop/IPE
Aut/datadriven.rb:59


plz look into that and do needful

Regards
Murali
___
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

[Wtr-general] need help on Data Driven

2007-07-09 Thread murali
Hi every one,

   iam facing problem with the data driven. have glance of my code and 
let me know where i did mistake.

excel= WIN32OLE::new('excel.Application')
workbook=excel.Workbooks.Open('D:\Documents and Settings\mmopur\Desktop\IPE 
Aut\test.xls')
worksheet=workbook.Worksheets(1)
worksheet.Select
excel ['Visible']
#worksheet.Range('a2') ['Value']
category=worksheet.Range('a2:a4') ['Value']
line = '1'
while worksheet.Range(a#{line})['Value']
   line.succ!
 
ie.text_field(:name,ctl00$ContentPlaceHolder1$txtCategory).set(category)


when i run the script iam getting the errors as belo mentioned

c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `+': can't convert Array into S
ring (TypeError)
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3431:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `each'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3427:in `doKeyPress'
from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3393:in `set'
from D:/Documents and Settings/mmopur/Desktop/IPE Aut/datadriven.rb:59


plz look into that and do needful

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