WindowsError: [Error 87] The parameter is incorrect

2,420 views
Skip to first unread message

lamb ele

unread,
Aug 3, 2013, 3:00:37 PM8/3/13
to seleniu...@googlegroups.com
Hi guys:
  I'm very new to selenium and have been trying to learn its python package by running scripts found on its documentation website: http://selenium.googlecode.com/svn/trunk/docs/api/py/index.html. But I got the following error as soon as I try to set up a firefox browser object:

from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    browser = webdriver.Firefox()
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 61, in __init__
    self.binary, timeout),
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 50, in launch_browser
    self._start_from_profile_path(self.profile.path)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 73, in _start_from_profile_path
    env=self._firefox_env).communicate()
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
WindowsError: [Error 87] The parameter is incorrect

When I was first trying to install selenium-server-standalone-2.28.0.jar, the process seemed to get stuck at "14:37:36.630 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@4fc5a2 f9". But later when I re-ran the command "java -jar selenium-server-standalone-2.28.0.jar" , it says"Selenium is already running on port 4444", so I assume that the first installation somehow got through. Is it an installation problem? Any help is appreciated! I'm using windows 7, 64

$ java -jar selenium-server-standalone-2.28.0.jar
Aug 03, 2013 2:37:36 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
14:37:36.505 INFO - Java: Oracle Corporation 23.7-b01
14:37:36.506 INFO - OS: Windows 7 6.1 amd64
14:37:36.514 INFO - v2.28.0, with Core v2.28.0. Built from revision 18309
14:37:36.606 INFO - RemoteWebDriver instances should connect to: http://127.0.0. 1:4444/wd/hub
14:37:36.607 INFO - Version Jetty/5.1.x
14:37:36.608 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
14:37:36.608 INFO - Started HttpContext[/selenium-server,/selenium-server]
14:37:36.608 INFO - Started HttpContext[/,/]
14:37:36.630 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@4fc5a2f9
14:37:36.630 INFO - Started HttpContext[/wd,/wd]
14:37:36.632 WARN - Failed to start: SocketL...@0.0.0.0:4444
Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or some other service is.
        at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:472)
        at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:280)
        at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:243)
        at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)




Krishnan Mahadevan

unread,
Aug 3, 2013, 3:44:45 PM8/3/13
to seleniu...@googlegroups.com
You don't need to start a selenium standalone server for you to work with the WebDriver.

$ java -jar selenium-server-standalone-2.28.0.jar <--- This is only required when you are trying to work with DefaultSelenium.

The error
Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or some other service is.

Is simply java's way of telling you that there is already something else that is listening on port 4444. It could be either another Selenium server or some other process.


You would need to list out the process that is listening on port 4444 and kill it.




Thanks and Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e5f6e6cf-096b-49fc-91ce-219a53e23ef4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sam Kernion

unread,
Oct 11, 2013, 1:29:13 PM10/11/13
to seleniu...@googlegroups.com
I am having the same issue with WindowsErroer: [Error 87].  Have you had any luck getting past this issue? I am using Python 2.7.5.3, firefox 24, selenium 2.35.  I was originally using python 3.3 and figured using 2.7 may help, but to no avail.

Thanks.

Kieran Tully

unread,
Oct 13, 2013, 5:04:43 AM10/13/13
to seleniu...@googlegroups.com
On Saturday, August 3, 2013 8:00:37 PM UTC+1, lamb ele wrote:
Hi guys:
  I'm very new to selenium and have been trying to learn its python package by running scripts found on its documentation website: http://selenium.googlecode.com/svn/trunk/docs/api/py/index.html. But I got the following error as soon as I try to set up a firefox browser object:

from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    browser = webdriver.Firefox()
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 61, in __init__
    self.binary, timeout),
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 50, in launch_browser
    self._start_from_profile_path(self.profile.path)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 73, in _start_from_profile_path
    env=self._firefox_env).communicate()
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
WindowsError: [Error 87] The parameter is incorrect

I ran into this this morning and the problem was that selenium couldn't find the path to firefox.exe.

Try adding it to your system PATH.

Or you can hardcode the path in your test script. See 

Hope that helps,
Kieran

Вадим Семенов

unread,
Aug 29, 2016, 10:10:06 AM8/29/16
to Selenium Users
Could you please help me - i can not to set up driver - i get error Windows error 87, i saw solution to add path to firefox, i have one: >set PATH
C:\Program Files (x86)\Mozilla Firefox;C:\PhantomJs\bin
But i get that error
>>> driver = webdriver.PhantomJS(executable_path='')

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py"
, line 52, in __init__
self.service.start()
File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", lin
e 64, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Python27\lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 958, in _execute_child

startupinfo)
WindowsError: [Error 87] The parameter is incorrect

воскресенье, 13 октября 2013 г., 12:04:43 UTC+3 пользователь Kieran Tully написал:
Reply all
Reply to author
Forward
0 new messages