acobster
acobster

Reputation: 1657

Protractor / Selenium standalone error "403 Forbidden for Proxy"

I'm using Protractor to run end-to-end JS tests within my Rails app. The following spec is failing:

# my_ctrl_spec.js.coffee
describe 'MyCtrl', ->
  it 'does a thing', ->
    expect( browser ).toBeTruthy()
    browser.get '/'

The spec passes with the last line commented out, but actually trying to navigate WebDriver gives me "Error 403 Forbidden for Proxy" on the rendered page.

Here is my protractor_conf.js file:

require('coffee-script/register');

exports.config = {
  capabilities: {
    'browserName': 'chrome',
  },

  specs: ['spec/javascripts/e2e/**/*_spec.js.coffee'],

  seleniumAddress: 'http://localhost:4444/wd/hub',
  seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar',
  baseUrl: 'http://localhost:4444',

  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000
  }
};

I'm also getting some errors telling me that "retries looking for angular exceeded," but I think that's because of the 403 error, not vice-versa.

Some system deets:

Can anyone see anything wrong with my setup?

Upvotes: 1

Views: 1938

Answers (1)

glepretre
glepretre

Reputation: 8167

I think you used baseUrl the wrong way: it should be the URL of the page you want to test, not the selenium adress.

If you use a webserver it could be http://localhost:8000 for example, if the page is already online just put its URL ;)

// A base URL for your application under test. Calls to protractor.get()
// with relative paths will be prepended with this.
baseUrl: 'http://localhost:9876',

Take a look at protractor/referenceConf.js for more info.

Upvotes: 1

Related Questions