aquality-selenium-dotnet icon indicating copy to clipboard operation
aquality-selenium-dotnet copied to clipboard

[dotnet core] Exception on File Upload to RemoteWebDriver / FireFox profile: System.NotSupportedException : No data is available for encoding 437

Open mialeska opened this issue 4 years ago • 0 comments

Getting Exception on File Upload to RemoteWebDriver

System.TypeInitializationException : The type initializer for 'System.IO.Compression.ZipStorer' threw an exception. ----> System.NotSupportedException : No data is available for encoding 437 There is a related selenium issue: https://github.com/SeleniumHQ/selenium/issues/4816 https://github.com/SeleniumHQ/selenium/issues/4816#issuecomment-476608576

A workaround should be included into Aquality.Selenium:

reference the System.Text.Encoding System.Text.Encoding.CodePages Nuget package and somewhere before Encoding.GetEncoding(437) gets called, make sure to call Encoding.RegisterProvider(CodePagesEncodingProvider.Instance).

Also we should use LocalFileDetector (as already used in java) for RemoteBrowserFactory

mialeska avatar Mar 03 '21 10:03 mialeska