-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
Description
Feature and motivation
.NET Framework did not differentiate between Linux & Mac, so there is no good way to ensure the right selenium-manager is used in .NET.
It's theoretically possible to use methods like:
RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
with:
using System.Runtime.InteropServices;
But we'd have to restrict it to .NET Framework 4.71+
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation?view=net-6.0#applies-to
AND. I can't even get the IDE to recognize it, let alone bazel.
Usage example
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
binary = "selenium-manager/windows/selenium-manager.exe";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
binary = "selenium-manager/linux/selenium-manager";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
binary = "selenium-manager/macos/selenium-manager";
}
else
{
throw new WebDriverException("Selenium Manager did not find supported operating system");
}