It's actually pretty simple if you're just using a CSV file. I don't
have my code in front of me at the moment, but I use a CSV file to
store information for a login test.
Basically, since all CSV is is "comma separated", you just open the
file like normal in ruby, read each line, and use .split
On Jul 25, 9:03 am, RAM wrote:
> Hi allI am very new to Watiranybody here knows how to
> import value from .CSV files and Export Results into an .CSV file in
> Watir.
> Please reply and provide links if similar subject is already posted.
I wrote a toy framework that does exact
I use CSV like that below
-import.rb-(csv import)-
#! ruby -Ku
#!/usr/bin/env ruby
require 'csv'
$KCODE = 'UTF8'
#import company-data settings
mhc = Array::new
CSV.foreach("data/company_var.csv") do |row|
company << Kconv.kconv(row.join(','),Kconv::UTF8)
end
$company_code
Sorry spread it.
This is that CSV sample.
--
ID,mnemonic,var-name,value
1,companycode,company_code,51236
2,companyname,company_name,Watir corp
3,company-zip-code,zip_code,111011
4,company-prefecture,select_prefecture,MA
5,company-prefecture for update,select_prefecture2,TT
6,co
miscode
mhc = Array::new
|
V
company = Array::new
On Mon, Jul 27, 2009 at 2:46 PM, takanobu watanabe wrote:
> I use CSV like that below
>
> -import.rb-(csv import)-
> #! ruby -Ku
> #!/usr/bin/env ruby
>
> require 'csv'
>
> $KCODE = 'UTF8'
>
> #import company-data settings
> mhc = Array::new
>
Hi Chris,
Your idea of implemnting a CSV based framework is very nice. It used a
lot in my current framework. - Thanks
Regards
Siva
On Jul 27, 10:56 am, takanobu watanabe wrote:
> Sorry spread it.
> This is that CSV sample.
> --
> ID,mnemonic,var-name,value
> 1,companycode,c