我正在尝试使用chromedriver 2.10在CentOS计算机上运行Chrome浏览器版本35.0.1916.114进行测试。
/home/varunm/EC_WTF_0.4.10/EC_WTF0.4.10_Project/wtframework/wtf/drivers/chromedriver
实际上,我已经解决了路径问题,因为如果问题是路径问题,则错误消息会有所不同。
def start(self):
"""
Starts the ChromeDriver Service.
:Exceptions:
- WebDriverException : Raised either when it can't start the service
or when it can't connect to the service
"""
env = self.env or os.environ
try:
self.process = subprocess.Popen([
self.path,
"--port=%d" % self.port] +
self.service_args, env=env, stdout=PIPE, stderr=PIPE)
except:
raise WebDriverException(
"ChromeDriver executable needs to be available in the path. \
Please download from http://chromedriver.storage.googleapis.com/index.html\
and read up at http://code.google.com/p/selenium/wiki/ChromeDriver")
count = 0
while not utils.is_connectable(self.port):
count += 1
time.sleep(1)
if count == 30:
raise WebDriverException("Can not connect to the ChromeDriver")
如果路径错误,我会收到其他错误信息,但现在出错了,是在建立连接时。