@@ -38,6 +38,9 @@ namespace OpenQA.Selenium
3838 /// </summary>
3939 public static class SeleniumManager
4040 {
41+ internal const string DriverPath = "driver_path" ;
42+ internal const string BrowserPath = "browser_path" ;
43+
4144 private static readonly ILogger _logger = Log . GetLogger ( typeof ( SeleniumManager ) ) ;
4245
4346 private static readonly Lazy < string > _lazyBinaryFullPath = new ( ( ) =>
@@ -80,7 +83,7 @@ public static class SeleniumManager
8083 /// <returns>
8184 /// An array with two entries, one for the driver path, and another one for the browser path.
8285 /// </returns>
83- public static SeleniumManagerPaths BinaryPaths ( string arguments )
86+ public static Dictionary < string , string > BinaryPaths ( string arguments )
8487 {
8588 StringBuilder argsBuilder = new StringBuilder ( arguments ) ;
8689 argsBuilder . Append ( " --language-binding csharp" ) ;
@@ -90,12 +93,17 @@ public static SeleniumManagerPaths BinaryPaths(string arguments)
9093 argsBuilder . Append ( " --debug" ) ;
9194 }
9295
93- var binaryPaths = RunCommand ( _lazyBinaryFullPath . Value , argsBuilder . ToString ( ) ) ;
96+ var smCommandResult = RunCommand ( _lazyBinaryFullPath . Value , argsBuilder . ToString ( ) ) ;
97+ Dictionary < string , string > binaryPaths = new ( )
98+ {
99+ { BrowserPath , smCommandResult . BrowserPath } ,
100+ { DriverPath , smCommandResult . DriverPath }
101+ } ;
94102
95103 if ( _logger . IsEnabled ( LogEventLevel . Trace ) )
96104 {
97- _logger . Trace ( $ "Driver path: { binaryPaths . DriverPath } ") ;
98- _logger . Trace ( $ "Browser path: { binaryPaths . BrowserPath } ") ;
105+ _logger . Trace ( $ "Driver path: { binaryPaths [ DriverPath ] } ") ;
106+ _logger . Trace ( $ "Browser path: { binaryPaths [ BrowserPath ] } ") ;
99107 }
100108
101109 return binaryPaths ;
@@ -109,7 +117,7 @@ public static SeleniumManagerPaths BinaryPaths(string arguments)
109117 /// <returns>
110118 /// the standard output of the execution.
111119 /// </returns>
112- private static SeleniumManagerPaths RunCommand ( string fileName , string arguments )
120+ private static ResultResponse RunCommand ( string fileName , string arguments )
113121 {
114122 Process process = new Process ( ) ;
115123 process . StartInfo . FileName = _lazyBinaryFullPath . Value ;
@@ -203,23 +211,19 @@ private static SeleniumManagerPaths RunCommand(string fileName, string arguments
203211 }
204212 }
205213
206- internal sealed record SeleniumManagerResponse ( IReadOnlyList < LogEntryResponse > Logs , SeleniumManagerPaths Result )
214+ internal sealed record SeleniumManagerResponse ( IReadOnlyList < LogEntryResponse > Logs , ResultResponse Result )
207215 {
208216 public sealed record LogEntryResponse ( string Level , string Message ) ;
209- }
210217
211- /// <summary>
212- /// Response from Selenium Manager about the paths and their locations.
213- /// </summary>
214- /// <param name="DriverPath">The path to the driver binary.</param>
215- /// <param name="BrowserPath">The path to the browser binary, or <see cref="string.Empty"/> if none exists.</param>
216- public sealed record SeleniumManagerPaths
217- (
218- [ property: JsonPropertyName ( "driver_path" ) ]
218+ internal sealed record ResultResponse
219+ (
220+ [ property: JsonPropertyName ( "driver_path" ) ]
219221 string DriverPath ,
220- [ property: JsonPropertyName ( "browser_path" ) ]
222+ [ property: JsonPropertyName ( "browser_path" ) ]
221223 string BrowserPath
222- ) ;
224+ ) ;
225+ }
226+
223227
224228 [ JsonSerializable ( typeof ( SeleniumManagerResponse ) ) ]
225229 [ JsonSourceGenerationOptions ( PropertyNameCaseInsensitive = true ) ]
0 commit comments