Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 697
Thomas Aylott Avatar asked Dec 29 '11 19:12

Thomas Aylott


3 Answers

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

i.e.

import selenium.webdriver as webdriver
webdriver.Remote('http://localhost:4444/wd/hub', {})
like image 157
Thomas Aylott Avatar answered Nov 18 '22 14:11

Thomas Aylott


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

like image 21
Karl Adler Avatar answered Nov 18 '22 14:11

Karl Adler


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

like image 1
Mahesh Sutar Avatar answered Nov 18 '22 13:11

Mahesh Sutar