Updated Chrome Browser not found in Selenium.WebDriver.ChromeDriver NuGet package - c#

The chrome browser upgraded to the version 89.0.4389.90.
But the Selenium.WebDriver.ChromeDriver nuget package is not available for the updated chrome version. How to upgrade selenium chrome web driver?

Chrome Selenium driver version "89.0.4389.23" is working for me with the Chrome version 89.0.4389.90 (windows 10 64 bit).
Download link: https://chromedriver.storage.googleapis.com/index.html?path=89.0.4389.23/
Can you see if it works for you as well.
I did faced an issue with chrome not starting with below error message:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: was killed.
(unknown error: DevToolsActivePort file doesn't exist)
As a workaround I did:
chromeOptions = webdriver.ChromeOptions()
chromeOptions.binary_location = "C:\...\chrome.exe"
b = webdriver.Chrome(options=chromeOptions, executable_path="<driver location>\chrome.exe")
After this I did not faced any crash issues.
Hope you find this helpful.
Note: The above code is in python but the approach should work for you.

Related

When refreshing the page Selenium.WebdriverTimeoutException : Timeout receiving message from renderer: 3000 with new Chrome 103 versions in Specflow

I am running my automation in VM and Chrome version gets automatically updated. Now my VM chrome version is 103.0.5060.114(64-bit).
However, my Selenium chrome driver version is 103.0.5060.5300 which is the latest one in Nuget. Problem is I can't downgrade chrome browser. I use driver.navigate().refresh() method which was working fine a month ago.
Recently I tried different ways of refreshing and added disabling gpu still having the issue. Not sure if Chrome and/or Selenium is aware of that.
Any suggestions?
Chrome Version 103.0.5060.114 is the most updated version and well supported by ChromeDriver 103.0.5060.53 (2022-06-22). So all seems well from configuration per se.
As per the ChromeDriver 103.0.5060.53 (2022-06-22) release notes:
Supports Chrome version 103
I downgraded Chrome from 103.0.5060.114-1 to 103.0.5060.53-1 on Ubuntu like so:
1st — uninstall the current Chrome via: sudo apt remove google-chrome-stable
2nd — install the deb binary file of the chrome that you want to have:
E.g.
wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_{VERSION}_amd64.deb"
sudo apt install ./google-chrome-stable_{VERSION}_amd64.deb
Particularly, what I entered into the command line to downgrade:
sudo apt remove google-chrome-stable
wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_103.0.5060.53-1_amd64.deb"
sudo apt install ./google-chrome-stable_103.0.5060.53-1_amd64.deb
Some resources I used when I was looking for the answer for myself:
How to update Chromedriver on Ubuntu?
https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
https://www.linuxjournal.com/content/how-can-you-install-google-browser-debian
If you are using some other system, I assume the approach would be the same.
I hope all of this would help you!

HTML to PDF using ironPDF getting error in AZURE WEBAPP:- Error while deploying Chrome dependencies [Issue Code IRONPDF-CHROME-DEPLOYMENT-ERROR]

I'm facing an issue while generating PDF from html using ironpdf on Azure web app.
This is the exception I get:
Exception details:
Error while deploying Chrome dependencies. To learn how to solve this issue please read https://iron.helpscoutdocs.com/article/166-error-while-deploying-chrome-dependencies [Issue Code IRONPDF-CHROME-DEPLOYMENT-ERROR]
I followed the steps given in documentation but not able to crack this,
Code is working fine in local environment, I'm facing the issue in Azure web app.
This is the code:
using IronPdf
var Renderer = new HtmlToPdf();
var PDF = Renderer.RenderHtmlAsPdf(fullhtml);
It is throwing the error at the last line shown - can someone guide me how to successfully deploy this to Microsoft Azure?
I also faced a similar kind of issue ([Issue Code IRONPDF-CHROME-DEPLOYMENT-ERROR-MAC-X64]).
Exception
Why Error It's because of upgrading an "IRONPDF" version. I upgraded that from my windows machine so when I switch to another windows os it works well, but when I switch to mac os it throws this error.
Solution
You have to install a "nuget package" according to your os. For my mac os, I need to install IronPdf.MacOs. So I executed the below command into the .net CLI, And after this installation, it worked perfectly fine.
dotnet add package IronPdf.MacOs --version 2022.12.11113
Here I attach my finding for the resolution, I hope it will also work for other os.
Source: Error while deploying Chrome dependencies
Package Source: nuget package for IronPdf.MacOs
Right click the Project --> Open Properties --> Go to Events Sections --> Copy the this path XCOPY "$(TargetDir)runtimes" "$(TargetDir)bin/runtimes" /S /E /Y /I /R /D --> paste in the post-build event section
Run it --> problem will be solved

check the version of downloaded webdriver programatically

I'm working on Selenium in C#. I had been using the webdriver manager to update the chrome and the firefox drivers.
new DriverManager().SetUpDriver("https://chromedriver.storage.googleapis.com/2.25/chromedriver_win32.zip",
Path.Combine(Directory.GetCurrentDirectory(), "chromedriver.exe"),
"chromedriver.exe"
);
but this is downloading the driver each time I run the program, I only want to download the driver even if it is not the latest version according to the browser's version.
How will I check the downloaded version or existing version of the web-driver
Thanks in advance

C# visual studio selenium for edge OS version18362

I am beginner of learning C# selenium using visual studio 2015.
I want to test a random website using edge browser. With the use of NuGet, I have installed selenium support (latest version)v3.141.0, selenium webdriver (latest version)v3.141.0 and selenium microsoft webdriver (latest version)v17.17134.0. However, the OS version on my laptop (latest window 10) is 18362 which is not available to download on official webdriver website.
The following code works well in chrome, IE, and firefox, but if I run the script below, I could successfully open the edge browser, but it does not proceed any more steps accordingly (just a edge browser displaying blank page).
The error I get is as followed: OpenQA.Selenium.WebDriverException: "A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:54095/session. The status of the exception was ReceiveFailure, and the message was: the underlying connection was closed. An unexpected ...."
I searched through the entire internet but still could not find out any relevant resources teaching how to configure edge webdriver in my current situation. Can someone point out mistakes I made and advise what should be done to solve this issue?
[TestMethod]
public void TestInEdge()
{
// Default option, MicrosoftWebDriver.exe must be in PATH
IWebDriver driver = new EdgeDriver();
driver.Navigate().GoToUrl("http://testwisely.com/demo");
System.Threading.Thread.Sleep(1000);
driver.Quit();
}
Microsoft WebDriver for Microsoft Edge (EdgeHTML) versions 18 and 19 is a Windows Feature on Demand which ensures that it’s always up to date automatically and enables some new ways to get Microsoft WebDriver.
To get started you will have to enable Developer Mode:
Go to Settings > Update and Security > For Developer and then select
“Developer mode”.
To install run the following in an elevated command prompt:
DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
Reference:
Microsoft WebDriver
Then after again try to run your code with Edge browser.

Selenium WebDriver 2.44 Firefox 33

I'm using Firefox version 33.1.1 and Selenium WebDriver 2.44. Selenium WebDriver was installed via Nuget using Install-Package Selenium.WebDriver. Previously I've had no problems running tests. I've started getting the following error on all my tests:
SetUp : OpenQA.Selenium.WebDriverException : Failed to start up socket within 45000 ms
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Looking at other sources of this error with different versions of Firefox and Selenium WebDriver, i.e. Failed to start up socket within 45000, they all seem to centre on incompatibility between the Firefox version and the Selenium version. However the release notes for Selenium 2.44 indicate compatibility with Firefox 33:
http://selenium.googlecode.com/git/dotnet/CHANGELOG
Has anybody else had this error with these versions of Firefox and Selenium?
It was a version problem after all. It turns out if you're updating Selenium via nuget, you need to be aware of which project the package manager console is pointing at. I'd managed to update my main project to Selenium 2.44 but my test project was still on version 2.40.

Categories