Only local connections are allowed Chrome & Seleni

2019-01-09 06:28发布

I am using Chrome webdriver 2.23 & Selenium 2.53.1 I have tried a lot but could not come the fix for this issue that whenever i run my selenium script it is giving me error

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

10条回答
做自己的国王
2楼-- · 2019-01-09 06:36

I saw this error

Only local connections are allowed

And I updated both the selenium webdriver, and the google-chrome-stable package

webdriver-manager update
zypper install google-chrome-stable

This site reports the latest version of the chrome driver https://sites.google.com/a/chromium.org/chromedriver/

My working versions are chromedriver 2.41 and google-chrome-stable 68

查看更多
走好不送
3楼-- · 2019-01-09 06:41

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

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

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

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 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

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

查看更多
冷血范
4楼-- · 2019-01-09 06:47
  1. Check the version of your installed Chrome browser.

  2. Download the compatible version of ChromeDriver from

    https://sites.google.com/a/chromium.org/chromedriver/

  3. Set the location of the compatible ChromeDriver to:

    System.setProperty("webdriver.chrome.driver", "C:\\Users\\your_path\\chromedriver.exe");
    
  4. Run the Test again.

It should be good now.

查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-09 06:47

I was able to resolve the problem by following steps: a. upgrade to the latest chrome version, clear the cache and close the chrome browser b. Download latest Selenium 3.0

查看更多
聊天终结者
6楼-- · 2019-01-09 06:48

Here you are a working stack:

Some previous notes:

1) Run sudo Xvfb :10 -ac &

2) Run export DISPLAY=:10

3) Run java -jar "YOUR_PATH_TO/selenium-server-standalone-2.53.1.jar" -Dwebdriver.chrome.driver="YOUR_PATH_TO/chromedriver.2.27" -Dwebdriver.chrome.whitelistedIps="localhost"

查看更多
叛逆
7楼-- · 2019-01-09 06:48

C#:

    ChromeOptions options = new ChromeOptions();

    options.AddArgument("C:/Users/username/Documents/Visual Studio 2012/Projects/Interaris.Test/Interaris.Tes/bin/Debug/chromedriver.exe");

    ChromeDriver chrome = new ChromeDriver(options);

Worked for me.

查看更多
登录 后发表回答