Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 11384 Only local connections are allowed - selenium

While running my Script with the latest Chrome Driver from Selenium's website I am getting the following error in the console:
Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 11384
Only local connections are allowed.
Can anyone please throw some light as to why am I getting this?

Related

Unable to start ChromeDriver in CI environment

I am using Selenium with ChromeDriver in .NET Core. All tests work fine locally, however fail in TeamCity with the following error:
Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987#{#882}) on port 24272
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
...
OneTimeSetUp: OpenQA.Selenium.WebDriverException : Cannot start the driver service on http://localhost:24272/
After the tests have finished, chromedriver.exe isn't terminated. There is nothing in the Windows event log or further details in the build logs, so I'm now stabbing in the dark.
I am using the following arguments, some added out of desperation:
var options = new ChromeOptions();
options.AddArgument("--headless");
options.AddArgument("--remote-debugging-port=9222");
options.AddArgument("--no-sandbox");
options.AddArgument("--no-first-run");
// See https://bugs.chromium.org/p/chromium/issues/detail?id=737678
options.AddArgument("--disable-gpu");
Driver = new ChromeDriver(options);
Interestingly, the remote debugging port != the port in the first error. Not sure if this means anything. The Chromedriver documentation suggests that options are added without leading --, but removing this doesn't seem to have any effect.
FWIW the TeamCity agent is running as a local Windows service account on Windows Server 2008 R2 (yes, I know).

Getting "Failed to start Selenium listener." error message while running testcafe script through saucelabs

I am trying to run testcafe script through saucelabs. But getting the following error message.
MAIN failed to create listener on port 4445
MAIN possible socket error: libevent connection error
Failed to start Selenium listener. Please make sure there are no other applications using the Selenium port, or specify an alternative port for Sauce Connect via the --se-port option (exit code 2).
It looks like another application already used the 4445 port (see a similar discussion here).
 
Also, you can use the official Saucelabs Troubleshooting Guide to fix this problem.

Selenium Standalone Servers giving error "DefaultRemoteProxy unknown version,Connect to 10.0.2.15:5566 [/10.0.2.15] failed: connect timed out"

Selenium Grid Testing:
I have installed virtual box in my system and I am trying to use my local system as hub and the windows machine in the virtual box as node.
Whatever the selenium standalone server I use ( I tried a lot of versions) but it is always giving me the error "DefaultRemoteProxy unknown version,Connect to 10.0.2.15:5566 [/10.0.2.15] failed: connect timed out" on the grid console.
In the Command Prompt initially it is saying that the node is registered successfully but after some time it is saying " Marking the node http://10.0.2.15:5566 as down: cannot reach the node for 2 tries".
I have attached the screenshot. Because of this the tests are failing.
I have disable the windows firewall as well on both local and virtual box windows systems. But still no luck.
Is there anything wrong I am doing?
Can someone please help me with this?
Selenium Grid Console:
After trying a lot, I got the answer finally. This is related to network setup between my local host and the VM.
In VMBox, under the settings for a particular system, under network I have added one more adapter which is "Host-only adapter" in addition to the NAT and it resolved my problem.

Selenium ChromeDriver Failed to load resource: net::ERR_CONNECTION_CLOSED

I'm using Codeception to run some acceptance tests using WebDriver and a Docker Selenium standalone server. I noticed that after one of my tests threw an error I get this logged:
[Selenium browser Logs]
13:59:52.345 SEVERE - https://ssl.google-analytics.com/ga.js - Failed to load resource: net::ERR_CONNECTION_CLOSED
Funny thing is that there isn't any google analytics on the page at all (or the app for that matter). I'm guessing that there is some anonymous usage analytics but can't tell whose it is, whether it's Selenium, Codeception or it's included libs, or even the ChromeDriver for Selenium. I run the Selenium server with --net=host and maybe that has something to do with it.
Anyone know how to turn these analytics off or let Codeception ignore failed external resources?
add the following entry to your local hosts file,
127.0.0.1 www.google-analytics.com
127.0.0.1 google-analytics.com
127.0.0.1 ssl.google-analytics.com
This works for all browsers, regardless of whether they support plugins. As long as you don't run a web server on your local machine, these connections are instantly rejected and so don't take very long to fail.
You could also try 0.0.0.0 (never personally tested by me though).
0.0.0.0 www.google-analytics.com
0.0.0.0 google-analytics.com
0.0.0.0 ssl.google-analytics.com
PS: 0.0.0.0, a null route, is better. If you're running your own web server you'll start to get 404s if your route to localhost.

The remote server returned an error: (401) Unauthorized when using any site

I am using Selenium to do some web testing. My code looks like this:
selenium = new DefaultSelenium("localhost", 80, "*firefox", "http://www.google.co.uk/firefox?client=firefox-a&rls=org.mozilla:en-GB:official"); ;
selenium.Start();
selenium.GetText("/html/body[#id='mozilla-com']/div[1]/div[2]/div[2]/h2/span");
However, I get an error stating:
The remote server returned an error: (401) Unauthorized.
Anyone have any ideas why?
Thanks
It looks like you are running in on port 80 which on Development machine with IIS will have a conflict.
when you start Selenium with java -jar Selenium-Server-Standalone.jar it starts up on Port 4444 by default so if you updated your test to
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.co.uk/firefox?client=firefox-a&rls=org.mozilla:en-GB:official"); ;
selenium.Start();
selenium.GetText("/html/body[#id='mozilla-com']/div[1]/div[2]/div[2]/h2/span");
It should do what you want. I have a Selenium C# tutorial on my site at http://www.theautomatedtester.co.uk/seleniumtraining/selenium_csharp_nunit.htm that should help you through the process. There are number of tutorials on my site if you get stuck