Selenium $ is not defined error

319 views
Skip to first unread message

sur...@mahaswami.com

unread,
Dec 14, 2015, 7:42:49 AM12/14/15
to Selenium Users
Hi,

Many times i am getting the following error, related to execute_script method.

Could someone explain what may be the cause of this error?

unknown error: $ is not defined
  (Session info: chrome=46.0.2490.80)
  (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.13.0-24-generic x86_64)
./lib/page_objects/driver.rb:230:in `close_notifications'
./spec/publisher/start_single_manual_relative_project_spec.rb:67:in `(root)'
228      # This assumes you are in the context of the notifications window
229      # removing mini-profiler from overlay as it blocks the close button
     @web_driver.execute_script("$('div.profiler-results').remove();")
231 @web_driver.find_element(:css, "#overlay_nav a").click 232 sleep 1 233# gem install syntax to get syntax highlighting

Regards,
Suresh.
Reply all
Reply to author
Forward
0 new messages