[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: batch import and export (CSV)



brush,


On Wed, 2007-10-31 at 16:20 -0700, brush wrote:
> On Wed, Oct 31, 2007 at 10:45:18PM +1100, Phil Rhoades wrote:
> 
> ... (re : importing)
> 
> > > > I have made a little progress using fireWatir to automate input but have
> > > > not had time to get back and sort out the remaining problems.
> > > > 
> > > > http://swik.net/fireWatir
> > > 
> > > i've looked a bit at *watir, and in worst case scenario that makes
> > > sense, but doesn't it officially qualify as a hopeless hack of a
> > > solution?  or is it a lot simpler and more elegant than it seems it
> > > would be?
> > 
> > 
> > Yes it is a bit of a hack but the main advantage is that transactions of
> > any kind, that affect any tables, are automatically handled by LS
> > itself, putting things into the right place instead of having to
> > reproduce LS results in scripts . . ie it is just speeding up normal
> > data entry.
> 
> ok... so, chris or other folks on dev't, should we consider this as a
> "foreseeable future" option?  or could a basic import functionality be
> nearer term?
> 
> phil, mind making your scripts available as something to work off of?
> 
> thanks folks,
> .b


Hereunder all I have done so far.  Unfortunately the results don't seem
consistent from run to run and I am not sure if it because I am doing
something dumb or because of fireWatir bugs?  I can't select the field I
want in the AP frame.

Regards,

Phil.


#!/usr/bin/ruby

require 'rubygems'
require 'firewatir'
include FireWatir
 
ff=Firefox.new
ff.goto( 'http://localhost/ledgersmb/login.pl' )
ff.text_field( :name, 'login' ).set( 'tst' )
ff.text_field( :name, 'password' ).set( 'FidelP206K' )
ff.button( :value, 'login' ).click
ff.show_frames()
puts '------------------------------------------------1'

fr_menu = ff.frame( :name, 'acc_menu' )  
fr_menu.link( :index, 15 ).click
fr_main = ff.frame( :name, 'main_window' )  
puts fr_main.show_all_objects()
puts '------------------------------------------------2'

puts fr_main.show_tables()
puts '------------------------------------------------3'

# puts fr_main.text_fields.length     
# fr_main.text_fields.each { |t| puts t.to_s }
# puts fr_main.text_fields[1].to_s

print 'fr_main.tables.length = ' ; puts fr_main.tables.length
fr_main.tables.each { |t| puts t.to_s }
puts '------------------------------------------------4'

print 'fr_main.tables[1].row_count.to_s = ' ; puts fr_main.tables[1].row_count.to_s
print 'fr_main.tables[1].column_values.to_s = ' ; puts fr_main.tables[1].column_values(1).each { |t|
# fr_main.tables[2].to_s
# print 'fr_main.tables[2].locate = ' ; puts fr_main.tables[2].locate


-- 
Philip Rhoades

Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275)
GPO Box 3411
Sydney NSW      2001
Australia
Fax:     +61:(0)2-8221-9599
E-mail:  ..hidden..