Skip to content

Commit

Permalink
[dotnet] Extend invalid selenium manager process exit codes (Selenium…
Browse files Browse the repository at this point in the history
…HQ#11361)

Extend invalid selenium manager process exit codes
  • Loading branch information
nvborisenko authored Dec 3, 2022
1 parent 397ecec commit 038141b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions dotnet/src/webdriver/SeleniumManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,24 @@ private static string Binary
if (string.IsNullOrEmpty(binary))
{
#if NET45 || NET46 || NET47
binary = "selenium-manager/windows/selenium-manager.exe";
binary = "selenium-manager/windows/selenium-manager.exe";
#else
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");
}
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");
}
#endif
}

Expand Down Expand Up @@ -145,9 +145,9 @@ private static string RunCommand(string fileName, string arguments)

string output = outputBuilder.ToString().Trim();

if (processExitCode > 0)
if (processExitCode != 0)
{
throw new WebDriverException($"Invalid response from process: {fileName} {arguments}\n{output}");
throw new WebDriverException($"Invalid response from process (code {processExitCode}): {fileName} {arguments}\n{output}");
}

return output.Replace("INFO\t", "");
Expand Down

0 comments on commit 038141b

Please sign in to comment.