只允许本地连接 Chrome 和 Selenium webdriver [英] Only local connections are allowed Chrome and Selenium webdriver

查看:19
本文介绍了只允许本地连接 Chrome 和 Selenium webdriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Chrome 网络驱动程序 2.23 &硒 2.53.1.我已经尝试了很多,但无法修复它.每当我运行我的 selenium 脚本时,它都会给我以下错误

I am using Chrome webdriver 2.23 & Selenium 2.53.1. I have tried a lot, but could not get it fixed. Whenever I run my selenium script, it is giving me the following error

Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 12162
Only local connections are allowed.

推荐答案

这只是一条信息性消息.您的问题可能是 chromedriver 和 selenium-server-standalone 的版本不匹配.

This is just an informational message. Your issue might be a missmatch between the versions of chromedriver and selenium-server-standalone.

尝试使用最新的 selenium 3.0 版,它对我有用.

Try with the latest selenium version 3.0, it is working for me.

请注意,对于 selenium 3.0,您需要先指定驱动程序,然后再指定 selenium 服务器.

Please not that for selenium 3.0 you need to specify the driver first and after the selenium server.

使用新的 selenium,即 3.0,您应该使用:

With the new selenium, which is 3.0 you should use:

java -Dwebdriver.chrome.driver=path_to_chrome_driver -jar selenium-server-standalone-3.0.0-beta2.jar如果您使用低于 3.0 的 selenium 版本,则需要使用驱动程序反转 selenium 的顺序,例如:

java -Dwebdriver.chrome.driver=path_to_chrome_driver -jar selenium-server-standalone-3.0.0-beta2.jar If you are using selenium version below 3.0 you need to reverse the order of selenium with the driver, like:

java -Dwebdriver.chrome.driver=path_to_chrome_driver -jar selenium_server.jar

在启动selenium server的时候,在chromedriver和selenium server所在的目录下打开一个控制台,执行上面的命令.

When you are starting the selenium server, open a console in the directory with chromedriver and selenium server and execute the above command.

这篇关于只允许本地连接 Chrome 和 Selenium webdriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆