selenium: Content-Type header is missing
💥 Regression Report
I cannot use RemoteWebDriver
in C# at all with the latest alphas. Apologies if this is a known issue, I can’t see anything so figured I’d report it. Seems like quite a fundamental issue though so maybe I’m missing something.
Last working Selenium version
Not sure what this means, the docker images go up to alpha 7, the nuget package only goes up to 5. Below are the Nuget package versions:
Worked up to version: 3.141.0
Stopped working in version: 4.0.0-alpha01-4.0.0-alpha05 (I can’t seem to get any v4 packages working, different errors on each version)
To Reproduce
Run docker compose using the file documented here: https://github.com/SeleniumHQ/docker-selenium/blob/trunk/docker-compose-v3.yml
dotnet new console -o "Example"
cd ./Example
dotnet add package Selenium.Support --version 4.0.0-alpha05
dotnet add package Selenium.Selenium.WebDriver --version 4.0.0-alpha05
Inside program.cs:
using System;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
namespace Example
{
class Program
{
static void Main()
{
new RemoteWebDriver(new Uri("http://localhost:4444"), new ChromeOptions());
Console.WriteLine("Done!");
}
}
}
The following exception is logged:
PS C:\File\Path\Example> dotnet run
Unhandled exception. OpenQA.Selenium.WebDriverException: Content-Type header is missing
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapab
Expected behavior
The exception should not be thrown and the driver should be useable.
Environment
Again not sure what to put here. My laptop is a windows laptop but the grid is running inside a linux container.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 25 (8 by maintainers)
Commits related to this issue
- [grid] Skipping content type check if session exists Fixes #8655 — committed to Bioshock667/selenium by diemol 4 years ago
Pushed a fix, prerelease docker images will be published soon