As I mentioned in your Stack Overflow question, http://stackoverflow.com/q/38274619/1200545, you need to set the DataMagic.yml_directory. Note that the yml_directory is the *directory* relative to the working directory (see the question for an example). It should not be a file (ie should not contain data_form.yml) and it is not likely to be relative to env.rb
- Justin Ko On Monday, July 11, 2016 at 3:49:14 PM UTC-4, Ajay Reddy wrote: > > Hello All, > I am getting this error "cannot load such file > -/pages/Config/data/data_form.yml (LoadError)", can any one fix this issue > please. > > Here is my scenario: > Scenario: Verify the xxx > Given I am on xxx web page > When I provide application information > And I select xxx button > And I click on xxx > Then I should xxx > > > Here is when: > When(/^I provide application information$/) do > submission = CardSubmission.new(@browser) > submission.submit_application > end > > > Here is cardsubmission class: > require "test_data.rb" > require 'yaml' > class CardSubmission < Main > 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 > > Here the TestData module: > module TestData > include PageObject > text_field(:name, :id => 'Name') > text_field(:mail, :id => 'Mail') > end > > > I am calling the data_magic gem in env: > DataMagic.yml_directory = 'pages/Config/data/data_form.yml' > > > > Thank You, > Ajay. > > > > -- -- 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.