jquery - $ is not defined error in Selenium test -
I am trying to test the jQuery auto-complete test in a Rail 3.2 application using Selenium. After the one I created, there is a fill_autocomplete helpful method that looks like this: Def fill_autocomplete (area, option = {}) with the FILL_IN field, Option [: with] Page.execute_script% Q {$ ('## {field}'). Trigger ('focus')} page Execute_script% Q {$ ('## {field}'). Trigger ('keydown')} When I run RSpec, I get this error: fill_autocomplete 'crop', with: 'm' selenium :: WebDriver Failure / Error:: Error: Javascript error: $ is not defined The problem is the line page. Execute_script% Q {$ ('## {field}'). Trigger ('Focus')} spec_helper.rb ENV ["RAILS_ENV"] || = 'Test' is required File .expand_path ("../../conf / environment", __FILE__) Requires' rspec / rails' 'rspec / autorun' is required 'coveralls '' Simplecov 'requires' capybara...