Ruby has a $LOAD_PATH constant that tells it where to look for things. I 
usually do something like this to add something for the 'root' directory where 
I have some files that I need to access:
root = File.expand_path(File.dirname(__FILE__))$LOAD_PATH.unshift(root)

And then you should be able to require things relative to whatever 'root' is.

      From: Ajay Reddy <sithagariajayre...@gmail.com>
 To: Watir General <watir-general@googlegroups.com> 
 Sent: Monday, July 11, 2016 8:13 AM
 Subject: [wtr-general] cannot load such file — Config/Data/data_form.yml 
(LoadError)
   
require "./TestData"
require 'yaml'
class CardSubmission < Application
  include PageObject
  include DataMagic
  include TestData

  def initialize(browser)
    @browser = browser
  end

  def submit_application(data = {})
    DataMagic.load ("data_form.yml")
    populate_page_with data_for(:Auto_Data, data)
  end
end
I am calling DataMagic.yml_directory = 'Config/data/data_form.yml' in env.rb
-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.
 
watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to