Ugh
Ran in to same problem (before reading this thread) and did do some
digging. Basically this could be webdriver problem. If I do this
(basically same this as Open Browser keyword does):
from selenium import webdriver
profile_dir = 'C:\\tmp\\ff_profile'
profile = webdriver.FirefoxProfile(profile_dir)
browser = webdriver.Firefox(firefox_profile=profile)
Then I get:
Traceback (most recent call last):
File "C:\tmp\webdriver.py", line 7, in <module>
browser = webdriver.Firefox(firefox_profile=profile)
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)
TypeError: environment can only contain strings
Where C:\\tmp\\ff_profile is just a copy of my Firefox 20.0.1
profile.
As a workaround downgrading to selenium 2.31.0 removes the problem
and there similar issues reported in the selenium bug tracker [1],
[2]. So best would be to use selenium 2.31.0 with Firefox 20 and
wait for new selenium release.
-Tatu
[1]
http://code.google.com/p/selenium/issues/detail?id=5508&q=TypeError%3A%20environment%20can%20only%20contain%20strings&colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary
[2]
http://code.google.com/p/selenium/issues/detail?id=5512&q=TypeError%3A%20environment%20can%20only%20contain%20strings&colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary