What errors are you getting?

I don't think this is your problem, but you might want to use this to simplify your code:

    line.chomp.split(',').each_with_index{|x,i|

Bret

On 7/27/06, aidy rutter <[EMAIL PROTECTED]> wrote:
Hi,
 
I am using Bret's AppMap concept
 
 def goto_territory_list
   ObjectMap.new.instance_eval  do
       sales_admin_link.click
       territories_link.click
    end
  end

but I am having a hell of a trouble trying to fit it into the below switch statement. Could anyone help?

  def enter_employees()
  File.open('C:\auto_tests\test_data\employee_data.csv','r') {|f| #use block so file is automatically closed

    f.each_line { |line|
    next if /^;/ =~ line #check for ';' at start of line
      i = 0
      line.chomp.split(',').each{|x|
      i += 1
      next if x.nil? or x == "null" #skip nil or "null" values
      case i
      when 1 #country
        employee_country_id.select(x)
      when 2 #depot
        employee_depot_id.select(x)
      when 3 #first_name
        employee_first_name.set(x)
      end
      puts "#{x} has been input"
      }
      click_submit
      click_new_employee_link
    }
  }
  end
end

cheers

aidy

 


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to