Thanks Johnssn, But where do you want me to add "root = File.expand_path(File.dirname(__FILE__))" and this too " $LOAD_PATH.unshift(root)".
On Monday, July 11, 2016 at 10:27:53 AM UTC-5, johnssn wrote: > > 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 <[email protected] <javascript:>> > *To:* Watir General <[email protected] <javascript:>> > *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) > endend > > > 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. > > [email protected] <javascript:> > http://groups.google.com/group/watir-general > [email protected] <javascript:> > > --- > 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 [email protected] <javascript:>. > 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. [email protected] http://groups.google.com/group/watir-general [email protected] --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
