Reputation: 675
I'm very new to selenium and I'm using its python package. So when I copied and ran the code found on its documentation page:http://selenium.googlecode.com/svn/trunk/docs/api/py/index.html, I got the following error:
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 followed this other documentation:http://selenium-python.readthedocs.org/en/latest/installation.html#downloading-python-bindings-for-selenium to install selenium.
At first when I ran virtualenv.py file the output would say setuptools*.tar.gz, pip.*.tar.gz not found, so I downloaded those two tar files and put them in seltests folder and then the terminal didn't complain anymore. So the installation should be successful. Any help is appreciated! I'm using windows 7, 64 bit.
Upvotes: 2
Views: 1284
Reputation: 450
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
Python selenium error when trying to launch firefox
Upvotes: 1