cheezy / page-object

Gem to implement PageObject pattern in watir-webdriver and selenium-webdriver
MIT License
653 stars 220 forks source link

wrong number of arguments (0 for 1..2) (ArgumentError) #416

Closed jmtabares closed 7 years ago

jmtabares commented 7 years ago

using Ruby 2.0.0 watir 6.2.0 page-object 2.0.0 fig_newton

wrong number of arguments (0 for 1..2) (ArgumentError) /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/page-object-2.0.0/lib/page-object.rb:78:in initialize' /Users/jair/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:13:ininitialize' /Users/jair/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/psych/nodes/node.rb:35:in new' /Users/jair/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/psych/nodes/node.rb:35:into_ruby' /Users/jair/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/psych.rb:130:in load' /Users/jair/Dev/qa-automation/agroptima-automation/features/support/pages/main_page.rb:10:in' /Users/jair/Dev/qa-automation/agroptima-automation/features/support/pages/main_page.rb:6:in <top (required)>' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:inload' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in load_code_file' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:142:inload_file' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:84:in block in load_files!' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:ineach' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in load_files!' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:253:inload_step_definitions' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:61:in run!' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:inexecute!' /Users/jair/.rvm/gems/ruby-2.0.0-p648/gems/cucumber-2.4.0/bin/cucumber:8:in <top (required)>' /Users/jair/.rvm/gems/ruby-2.0.0-p648/bin/cucumber:23:inload' /Users/jair/.rvm/gems/ruby-2.0.0-p648/bin/cucumber:23:in <top (required)>' -e:1:inload' -e:1:in `

'

cheezy commented 7 years ago

Can you show me the code for main_page.rb - specifically around line 10?

yudi2312 commented 7 years ago

@cheezy -> Hi Jeff, Any update on this?

AlexisKAndersen commented 7 years ago

Without seeing the code, all I can imagine is to make sure you're passing the watir browser when initializing your page. Or preferably use the built in navigation methods visit and on. If these don't address your problem feel free to reopen and provide the code being executed that's failing.