Selenium WebDriver - FirefoxDriver error: Failed to start up socket within 45000 - selenium

I'm getting this error:
tests.IntegrationTests.Selenium.RegisterAndLogin (TestFixtureSetUp):
SetUp : OpenQA.Selenium.WebDriverException : Failed to start up socket within 45000
when I carry out the following in my code:
using System;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;
namespace ekmProspector.tests.IntegrationTests.Selenium
{
[TestFixture]
public class RegisterAndLogin
{
private IWebDriver driver;
[TestFixtureSetUp]
public void Init()
{
driver = new FirefoxDriver();
}
}
Can't get much simpler really, but the error is fatal. Any ideas?

Solution is as easy as pie :)
Right Click on your .Net (C#) Project and select 'Manage NuGet Packages ...' option, as shown below:
Then select Selenium specific packages, they need updated so update them.
The updated packages will be updated automatically.
It works for me.

I got this working in the end, I removed all the package sub-folders which were added by NuGet when installing WebDriver and decided to added these manually. Created a 'lib' folder, then unzipped the selenium binaries into that folder. Then added references to all the binaries. Seems to be fine now.

Versions
FF v48
Selenium Webdriver v2.53.1
Windows 7 (x64)
.Net 4.0 and .Net 4.5
Trying the fixes
As per #jaffa I manually added the following refereces and got the problem:
WebDriver.dll v2.53.1
WebDriver.Support.dll v2.53.1
I then unreferenced them and followed #HassanRahman and used NuGet:
WebDriver.dll v2.53.1
WebDriver.Support.dll v2.53.1
Still same error.
OpenQA.Selenium.WebDriverException : Failed to start up socket within 45000
Troubleshooting
I had a hunch and decided to downgrade from targeting .Net 4.5 to .Net 4.0 (Full not client profile) and the error changed to:
An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll
Additional information: Cannot find Firefox binary in PATH or default install locations. Make sure Firefox is installed. OS appears to be: Vista
I wondered if this is why people who reinstalled FireFox got it to work again?
Somewhere there has to be a set of Registry Keys or an Environment Variable to find FireFox's ApplicationStartupPath. You can see some of those paths in this ProcessMonitor trace:
In the screenshot above you can see the app (AstrobLabe) I'm using running this line of code:
using (IWebDriver driver = new FirefoxDriver(ffprofile))
It causes a search for FireFox v48 and its looking in the wrong directory:
C:\Program Files (x86)\Mozilla FireFox\FireFox.exe
On my system FireFox is installed in:
C:\Program Files (x86)\Mozilla\Firefox\FireFox.exe
Anyway finding and correcting this issue (Cannot find Firefox binary in PATH or default install locations) is for someone else to fix, I just copied the Firefox directory to Mozilla FireFox.
But then it goes back to the original error:
An unhandled exception of type 'OpenQA.Selenium.WebDriverException' occurred in WebDriver.dll
Additional information: Failed to start up socket within 45000 milliseconds. Attempted to connect to the following addresses: 127.0.0.1:7055
Solution
Then I came across this answer which says that FireFox v46 works with Selenium 2.53:
Which Firefox version is compatible with Selenium 2.53.0?
When I downgraded I saw that FFv46 installs to:
C:\Program Files (x86)\Mozilla FireFox\FireFox.exe
So check if your FF install is in this location - which based on the ProcessMonitor Trace Selenium cant find:
C:\Program Files (x86)\Mozilla\Firefox\FireFox.exe

I solved this by completely removing firefox and all profiles and reinstalling.

I found that I was able to to fix this problem in Firefox Selenium by updating my Selenium packages in NuGet.
But it still leaves you with the problem of manually updating the Chrome and IE drivers if similar problems arise.

I also faced the problem while running the the test in NUnit. I found many solution to remove or degrade your Firefox.But i solved this in another way i remove all the references related to web drivers and add the upgrade web driver to the Solution.
In my application the webdriver version was 2.24 so i replaced with 2.43 and now my test are running fine.

For anyone finding this question more recently (2015-02-27), there seems to be an open issue with compatibility with Selenium and Firefox 36:
https://code.google.com/p/selenium/issues/detail?id=8399
You can download Firefox 35 here: http://www.filehippo.com/download_firefox/59889/

I had this issue with latest version of both Firefox (42) and Selenium (2.48.2). Uninstalling and re-installing (via Nuget) fixed the issue for me.

I found that running an older version of resharper (9.2) failed to work with the latest nunit and that caused selenium to timeout.
The temporary solution was to disable resharper (Tools -> Options -> Resharper -> Disable), the permanent solution is upgrading resharper.

None of the previous answers clearly state that specific versions of Selenium WebDriver work with specific versions of Firefox. This SO question tells us that the Webdriver/Firefox compatibility matrix is here.
The other thing worth stating is that Firefox tends to update itself more-or-less automatically when new versions become available, depending on settings. Since Webdriver does not update itself automatically, this opens up the possibility that the Webdriver/Firefox compatibility will unexpectedly break and your test scripts will stop running when Firefox updates itself to a version that is not supported by your Webdriver version. I suspect that the answers above that instruct users to re-install Webdriver using Nuget simply pick up the newest Webdriver which works with the newest Firefox that just installed itself on your machine.
To prevent Firefox from upgrading itself, click on the menu button in Firefox (three horizontal bars, upper-right corner), choose "Options", choose "Advanced" on the left menu, choose the "Update" tab at the top and you'll see a set of radio buttons under "Firefox updates". Choose a setting other that "Automatically install updates".

Reinstalling FF browser fixed the issue.

Which version of Selenium IDE you are using? Try downgrading the Firefox version. The release notes of selenium IDE is mentioned in below link.
https://code.google.com/p/selenium/wiki/SeIDEReleaseNotes
Hope this helps.

1) Downgrade your firefox to < 19 because if i remember correctly WebDriver 2.33 support maxim Firefox 19
2)
FirefoxProfile profile = new FirefoxProfile();
profile.Port = 9966;
Global.Driver = new FirefoxDriver(profile);
P.S. I'm using firefox 16 to not have this issue

I have same issue with selenium version 2.37.xx with Firefox browser 42.0
After updating selenium version 2.48.2 issue is fixed

I was working with on C# with WebDriver 2.53/Firefox 46. Tried reinstalling things, manually re-adding etc but downgrading Firefox to 43 fixed it for me.

Updating through "NuGet" is what helped me. Firefox 47 and Selenium Webdriver 2.53 wasn't working. Checking the selenium site, it still shows "2.53" as their latest. Checking "NuGet" though, I saw there was a "2.53.1" version available. Installing that version is what got my Firefox 47 to work again.

Error image
See the error image, I uninstalled completely and re-install version46, things solved.

Related

Selenium - This version of ChromeDriver only supports Chrome version xx

Suddenly today all my tests stopped working, giving me following error message:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 97
Current browser version is 99.0.4844.51 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
I have not updated the browser (auto-update is disabled) before the error occurred, i haven't changed anything at all. I have now downloaded Version 99.0.4844.51 of both the browser as well as driver but I still get the very same error.
I've tried every solution i could find on here and the internet (although most were just "update your stuff") but nothing has worked.
go to https://chromedriver.chromium.org/ and download the latest stable version of chromedriver and download it in your project folder.
As of September 2022, the following solution worked for me on an M1 Macbook.
Uninstall the Chrome browser
Then uninstall chromedriver brew uninstall --cask chromedriver
Re-install the Chrome browser
Then re-install the chromedriver brew install --cask chromedriver
I had the same issue, chromedriver stays linked for old version of chromedriver even if new version was updated. Try to use instructions below, for me it was helpful:
Go to manage nuGet packages..
then go to browse tab and search the package with keyword: "Selenium.Chrome.WebDriver" (For other browser, install corresponding package)
and then install it. (Note: if it is already installed then remove the package before installing it.)
update your chrome driver from here: http://chromedriver.chromium.org/downloads and save it to your local machine and give the path of it into your code.(var driver = new ChromeDriver(#"C:\Libraries");)
You should see your version on your chrome navigator and use the same. Help/ About and see the version.
I had the same problem, to fix it you need to verify if your Google Chrome version is updated.
Open Google Chrome and go to settings
[image1]: https://i.stack.imgur.com/GzOzy.png
Verify your Google Chrome version
[image2] https://i.stack.imgur.com/o2Vmn.png
Update your chrome version
[image3]: https://i.stack.imgur.com/dsZNd.png
And run again your test

ERROR org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value' using Java [duplicate]

I am getting the below error while sending keys.
Result Message:
System.InvalidOperationException : unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.14393 x86_64)
I have updated the chrome driver to 2.36 but still my code search for 2.33?
Any idea ?
I've gotten the same error, please download the last ChromeDriver version and/or update chrome browser version and it will be working fine :)
https://chromedriver.storage.googleapis.com/index.html?path=2.36/
After updating the Google Chrome browser to Version 65.0.3325.146 (Official Build) (64-bit), I'm also encountered with the same error
while sending values to the input field, here's the error message...
selenium.common.exceptions.WebDriverException: Message: unknown error: call function result missing 'value'
using Chromedriver 2.32 and Google Chrome 65.0
As I did some research on the same, I found a recent commit on Google chrome v65 changelogs which help me to resolve the issue.
Solution:
Update Google Chrome to latest stable version (in my case it's v65 on 9/mar/2018)
Download and configure latest chromedriver (v2.36).
For configuring chromedriver (on Ubuntu) follow these steps...
Extract the downloaded zip file.
Copy the extracted chromedriver file to /usr/local/bin or to the location where you usually store the executable binaries.
Add the same path (where you place the chromedriver file) to environment variable PATH as
export PATH=$PATH:/usr/local/bin
For testing the installation, restart the terminal and type this command
chromedriver --version
it would show the version of chromedriver that you just installed.
Note: If the chromedriver already installed and configured then just replace the existing driver file and If you don't know where the Chromedriver binaries already stored then try to find the file using following command
sudo find -H / -type f -iname chromedriver
It is because of the update of chrome browser version from 64.xx to 65.xx
Now you have 2 options to run your tests successfully.
Downgrade your chrome browser to previous version and with the old chromedriver which you have now.
Upgrade your Chromedriver to 2.36 version with the updated Chrome browser.
visit https://chromedriver.storage.googleapis.com/index.html?path=2.36 and download the new chromedriver.
Option 2 is better.
Replace your ChromeDriver.exe with latest version.. Same can be downloaded from Google easily.
Also its better to get it done automatically by using webDriver manager as explained below -
1. Add Mvn dependency to your project POM:
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>${webdrivermanager.version}</version>
<scope>test</scope>
</dependency>
Now in your Browser instantiation class instead of using traditional way to create driver i.e. by using System.setProperty(See belwo)...
System.setProperty("webdriver.chrome.driver","src/test/resources/drivers/chromedriver.exe");
Use below approach:
WebDriverManager.chromedriver().setup();
webDriver = new ChromeDriver(chromeOptions);
And that's all, you are done!
Use below links for your reference-
What is Browser Binary Manager how to use it for Selenium
or chkout git project for same-
https://github.com/bonigarcia/webdrivermanager#webdrivermanager-as-java-dependency
Need to update chromedriver :
In console, run: chromedriver-update 2.36
The error says it all :
System.InvalidOperationException : unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.33.506120
The error clearly complains about InvalidOperationException
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.33
Release Notes of chromedriver=2.33 clearly mentions the following :
Supports Chrome v60-62
You are using chrome=65.0
Release Notes of ChromeDriver v2.37 clearly mentions the following :
Supports Chrome v64-66
Your Selenium Client version is unknown to us.
So there is a clear mismatch between the ChromeDriver version (v2.33) and the Chrome Browser version (v65.0)
Solution
Upgrade Selenium to current levels Version 3.11.0.
Upgrade ChromeDriver to ChromeDriver v2.37 level.
Keep Chrome version in between Chrome v64.x-66.x levels. (as per ChromeDriver v2.37 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Browser/Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Browser/Web Client.
Execute your #Test.
If you are on Mac:
brew upgrade selenium-server-standalone
brew upgrade chromedriver
if the above two are not installed:
brew install selenium-server-standalone
brew install chromedriver
I'm running Protractor and have encountered the same issue.
The solution in my case was rather simple.
$ npm update protractor -g
$ webdriver-manager update
If you are on the latest stable Google Chrome (e.g. 67) I recommend to:
brew uninstall chromedriver
brew tap homebrew/cask
brew cask install chromedriver
These set of commands will uninstall your current chromedriver, check for updates and install the latest found (e.g. 2.40).
Use xpaths instead of class names to locate elements
After updating chrome and its drivers it didn't helped me at all!!
I don't know how much it makes sense but it worked for me when i replaced class name with xpath. This is the xpath , i used to automate sending whatsapp message using python.
driver.find_element_by_xpath('//*[#id="main"]/footer/div[1]/div[2]/div')
previously i Was Using
driver.find_element_by_class_name('Some class Name Here')
In my case the team I'm on points selenium to a specific chromedriver file we had. In order to get Selenium to use the updated chromedriver, I first installed it with brew and then created a symbolic link to point where Selenium looks for it:
brew install chromedriver
ln -s /usr/local/Cellar/chromedriver/2.36/bin/chromedriver /path/where/selenium/expects/chromedriver
On the chance this might be helpful to someone I needed an additional step:
I am on MacOS X. I did
brew upgrade chromedriver
bundle exec chromedriver-upgrade
I have the chromedriver-helper gem installed, but it is stashed and requires the "bundle exec" prefix or the shell can't find the command.
The above fixed my problem.
As mentioned by others, the latest chromedriver did the trick for me. In case you downloaded the driver manually and want to tell appium to use the new chromedriver you can do so by this command:
appium --chromedriver-executable /path/to/driver/chromedriver ....
I'm running Protractor (webdriver-manager) with Selenium in a Windows environment, and I had to do the following:
webdriver-manager update --versions.chrome="2.36" (This downloaded the new Chromedriver to the right path but didn't enable it in protractor.)
Edit %userprofile%\AppData\Roaming\npm\node_modules\protractor\config.json and changed the chromedriver value from 2.32 to 2.36.
Delete my old chromedriver_2.32.exe from %userprofile%\AppData\Roaming\npm\node_modules\protractor\selenium for good measure (not sure if that was required.)
Or:
When another Chromedriver update became needed, I was no longer able to update this way. A configuration setting still expected the old path and filename, and I couldn't figure out where to change that setting. So I just renamed the latest chromedriver to "chromedriver.exe" and stuck it in C:\Windows\system32 (which is always referenced by PATH). Crude, but effective.
If you're using gulp-protractor plugin, make sure to update it as well.
I don't know if you're still on this, but I was receiving a similar error. I had the latest version of chromedriver in my PATH and Google Chrome was updated. I run Python 3.6 on windows 10 x64 bit. What I was getting trying to select a value from a dropdown menu on a webpage. The weird thing was, it would select the dropdown value correctly and the page would be updated nicely, but I'd receive that stupid error anyway and my script would freeze. So I just made an exception error handler for it, because like I said it selected the dropdown value correctly, so I just wanted to bypass that dumb error message:
# select by value
try:
select.select_by_value('100')
except:
pass
hopefully someone finds this helpful.
The issue is because of mismatch in chromedriver and chrome browser version.
Below link specifies the versions of chromedriver supporting the chrome browser's version.
http://chromedriver.chromium.org/downloads

Version compatibility of Firefox and the latest Selenium IDE (2.9.1.1-signed)

I visited https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/
to install the latest Selenium IDE (v 2.9.1) in Firefox.
My Firefox version is 54 (64-bit)
OS: Windows 10 Pro 64-bit (10.0, Build 14393)
But unfortunately "Add to Firefox" button was shown disabled on the site https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/
On that site NOTE was found as:
Note: Selenium IDE will NOT work on Firefox version 55 onwards. Please stay on Firefox version 54 or older.
What can I do to install Selenium IDE on FF 54?
Sad but true, It is no secret by now that Selenium IDE will be deprecated. In fact, it has already stopped working since Firefox 55. Here are some potential replacements that you may consider applying to your project:
Robot Framework
Katalon Studio
Protractor
TestProject
Good luck and Good bye Legend.
I think Firefox is not supported Selenium IDE after 53 or 54 version, I have read that blog
https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/
Firefox 55 doesn't support Selenium IDE 2.9.1. FF 54 and less are OK.
Installation Selenium IDE on FF 54:
1. Open Firefox 54 and visit https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/
2. Click "Download Anyway" link to download (In my case, it was selenium_ide-2.9.1-fx.xpi)
Open .xpi file you download in Firefox 54 -> Click Install and then Restart Now according to following interface:
I faced the similar issues few weeks ago.Firefox version 55 doesn't support Selenium IDE. You need to downgrade your Firefox browser to Firefox version 54, 53 or below.
For doing so, please refer the link below
https://support.mozilla.org/en-US/kb/install-older-version-of-firefox
Also, you need to delete all your old firefox data before installing older version because it might not work if you don't do so.
Then finally you can add Selenium IDE and it works fine.
I need to run Firefox 54 with Selenium but, like the others on this question, wasn't able to easily install Selenium. I did find a way to do this without going to a 3rd party site by copying the XPI download link (just right click on the disabled Add to Firefox button in the Firefox Add-ons page and copy the location), downloading it within Chrome or another browser, and finally just drag and drop the XPI into Firefox. That worked for me, hope this helps someone else.
Ironically, the best versions of selenium and Firefox that work better, powerful and with more options (according to my experience), are those, Firefox 54.0.1 and selenium 2.9.1. Despite they are deprecated. So I understand well your question and need.
Here you have a trick to install that Selenium version in that Firefox version, getting away the inactive add-on button:
Download manually the selenium version 2.9.1 (as a file) and then add it manually through "Install Add-on from file" in Firefox in the section "Extensions".
This is the link to download selenium 2.9.1:
https://ui.vision/howto/getseleniumide

Selenium not working in firefox 23.0.1 (Mac and Windows)

I have a client who had a script working and now stopped working. I run it in my computer and it works (i runned it on Linux and Windows). My client runned it on Mac and Windows.
I am new to Selenium, but the part of the code that crashes is where Selenium takes place, it gets the Firefox to open but not load the page. I think it migth be a problem with the webDriver of Selenium that must be updated.
I told him to install pip in his Mac and uninstall Selenium and reinstall it, is this how it is done in OS machines? Is there any issue related to my problem?
Thanks
It would be helpful if you had specify Selenium version and also which browser are you using and it's version too. But the behavior you described seems to be caused by having newer version of browser which the Selenium version you using doesn't support. So upgrading to newest version of Selenium (2.35) will likely make this problem disappear.

Selenium WebDriver: Could not load file or assembly 'Newtonsoft.Json Version=4.0.2.0'

Selenium's webdriver gives me that error when trying to use the Chrome or IE driver.
I have got Selenium via Nuget, so it should be giving me the correct libraries. However, it seems to want a reference to Newtonsoft.Json 4.0.2.0 rather than 4.0.3 which is the one currently inside the NuGet package.
How do I get round this issue?
UPDATE
I got this working, in part trying to fix another problem. See my other post:
Selenium WebDriver - FirefoxDriver error: Failed to start up socket within 45000
It's the Nuget package. Selenium is relatively new to Nuget, and the team has been having problems building a package that can be used easily. The primary .NET developer has said that the 2.8.x Nuget package will be better. That's due out sometime this week.
you need to use x86 not ANY CPU, then will work. Your project is set to ANY CPU. Change it to x86.