Home > Software design >  SetUpDriver() fails with 'The remote server returned an error: (404) Not Found.'
SetUpDriver() fails with 'The remote server returned an error: (404) Not Found.'

Time:07-13

I am using the Selenium WebDriverManager nuget package to manage driver versions. When I try to get the edge driver:

var driverManager = new DriverManager();
driverManager.SetUpDriver(new EdgeConfig());

It fails with:

System.Net.WebException: 'The remote server returned an error: (404) Not Found.'

I've tried updating my nuget packages which didn't help. I also found a related but unanswered question about Chrome driver - System.Net.WebException : The remote server returned an error: (404) Not Found

Any idea what is causing this error and how to fix it?

CodePudding user response:

So I am having the same issue, if you break your code and step into it at driverManager.SetUpDriver(new EdgeConfig());

and view the details you'll see the URL it's using and trying to go to is here https://msedgedriver.azureedge.net/103.0.1264.51/edgedriver_win64.zip which doesnt exist (in checking my own up to date edge driver it is .49, so .51 doesnt exist because the updates didnt get that high yet.

That version exists for MAC and Linux, but not Windows. For a fix I think you can set the type to be Windows only or something so it stops picking up a version that doesnt exist for Windows. This fix is in theory as I haven't tried it yet. Hope it helps.

Nicole

Editing this to give an update: I tried this and there's no way to set the OS and it is recognizing the OS since the URL extension is win64...I think this is a bug with webdriver manager that needs to be resolved on their end because it's recognizing the OS properly and even if you manually set it in code to grab latest it tries to grab the latest which was only released to Linux and Macs (seems like they need to include a filter to find latest and match on OS, not sure where to report this though to get it fixed). If you manually set the version to "100.0.1154.0" which is the latest for win64 then it works again. You can see all the releases at their website (https://msedgedriver.azureedge.net), but like I said its a but where latest or default is looking at date only and not filtering by the OS so when they drop a new one and its not for all the OS's then it breaks (this is my assumption, having trouble finding it in their source code which I dont think is available via VS when you install the package).

If anyone finds anything please chime in! Would love to know if there was a workable solution to filter ourselves until it's fixed.

  • Related