Thomas Aylott
Thomas Aylott

Reputation: 899

Selenium WebDriver HTTP ERROR: 403 Forbidden for Proxy RequestURI=/session

Running a Selenium 2 RemoteWebDriver server using java -jar selenium-server-standalone-2.15.0.jar.

I always get the error:

HTTP ERROR: 403
Forbidden for Proxy
RequestURI=/session

when connecting to it using the python WebDriver client:

import selenium.webdriver as webdriver
webdriver.Remote('http://localhost:4444', {})

or any other various RemoteWebDriver client I could find.

Upvotes: 18

Views: 22350

Answers (3)

Mahesh Sutar
Mahesh Sutar

Reputation: 96

You have another process which is bound to same port i.e 4444.

Selenium Grid by default uses port:4444.

You either need to kill the process which is bound to port:4444 or else you need to use another port(below used 5555) for your hub.

Use following in command prompt:

java -jar selenium-server-standalone-2.15.0.jar -role hub -port 5555

Upvotes: 1

Karl Adler
Karl Adler

Reputation: 16786

Not a solution to the exactly Problem, but for people getting this error:

HTTP ERROR: 403

Forbidden for Proxy
RequestURI=/

Powered by Jetty://

This error appears e.g. if multiple instances of Selenium are running, so you need to shut it down by browsing to URL:

http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer

If another instance was running there should appear okok

Upvotes: 3

Thomas Aylott
Thomas Aylott

Reputation: 899

The solution was simple: Use the pathname /wd/hub

i.e.

import selenium.webdriver as webdriver
webdriver.Remote('http://localhost:4444/wd/hub', {})

Upvotes: 38

Related Questions