0

Chromedriver does not start a Browser and causes tests to fail when run selenium tests from Teamcity and Jenkins, which both give same error messages:

Starting ChromeDriver 76.0.3809.126 (d80a294506b4c9d18015e755cee48f953ddc3f2f-refs/branch-heads/3809@{#1024}) on port 51389 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

However, with exactly same Chromedriver my tests run without any issues from visual studio and command prompt

Command used to run tests: dotnet test --filter TestCategory=Blank

Chrome version: 76.0.3809.132

Chromedriver version: 76.0.3809.126

OS: Windows 10

  • https://stackoverflow.com/questions/55069656/please-protect-ports-used-by-chromedriver-and-related-test-frameworks-to-prevent – daggett Sep 06 '19 at 06:57
  • The above message is a general log from chrome driver which it prints while it starts. There is no error in it. – Sujit kumar Sep 06 '19 at 15:06
  • @daggett Thanks for the suggestion. However, I've tried adding --whitelist-ip %* or --whitelist-ip '' to ChromeOptions, neither have made the trick for me. – user2951611 Sep 08 '19 at 23:18
  • @Sujitkumar You maybe right, but if there's no errors then I don't understand why Chromedriver does not start chrome, cause exactly same code works fine without CI. – user2951611 Sep 08 '19 at 23:21

1 Answers1

0

Not sure about Teamcity yet, but for Jenkins, when it's running as a service on Windows, it cannot work with UI, hence it does not show browsers even "Allow service to interact with desktop" is ticked.

The solution is to run Jenkins from jenkins.war as specified in Jenkins : Selenium GUI tests are not visible on Windows