page.onError - msg: ReferenceError: Can't find variable: $

1,061 views
Skip to first unread message

Jevgenijus Popovas

unread,
Jun 23, 2014, 9:23:40 AM6/23/14
to phan...@googlegroups.com

Hi, our website has moved all of its resources to Cloudfront
After that phantomjs is failing with this message:
  1 PhantomJS is launching GhostDriver...
  2 [INFO  - 2014-06-23T06:37:15.695Z] GhostDriver - Main - running on port 57166
  3 [INFO  - 2014-06-23T06:37:15.874Z] Session [d0f4c3a0-faa0-11e3-a47e-ff992de1443f] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascript
  4 [INFO  - 2014-06-23T06:37:15.874Z] Session [d0f4c3a0-faa0-11e3-a47e-ff992de1443f] - page.customHeaders:  - {}
  5 [INFO  - 2014-06-23T06:37:15.874Z] Session [d0f4c3a0-faa0-11e3-a47e-ff992de1443f] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverNam
  6 [INFO  - 2014-06-23T06:37:15.874Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: d0f4c3a0-faa0-11e3-a47e-ff992de1443f
  7 [ERROR - 2014-06-23T06:37:20.350Z] Session [d0f4c3a0-faa0-11e3-a47e-ff992de1443f] - page.onError - msg: ReferenceError: Can't find variable: $
  8 [ERROR - 2014-06-23T06:37:20.350Z] Session [d0f4c3a0-faa0-11e3-a47e-ff992de1443f] - page.onError - stack:

And none of the resources are loaded. Anyone knows what happens here?
So far from google search it seems like there is no fix for this.

Jevgenijus Popovas

unread,
Jun 23, 2014, 2:13:02 PM6/23/14
to phan...@googlegroups.com
Fixed by adding proper capabilities:
capabilities = Selenium::WebDriver::Remote::Capabilities.phantomjs('phantomjs.page.settings.userAgent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36')
Reply all
Reply to author
Forward
0 new messages