File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121using System . Diagnostics ;
2222using Newtonsoft . Json ;
2323using OpenQA . Selenium . Internal ;
24+ using System . Globalization ;
2425
2526#if ! NET45 && ! NET46 && ! NET47
2627using System . Runtime . InteropServices ;
@@ -50,8 +51,16 @@ public static string DriverPath(DriverOptions options)
5051 var binaryFile = Binary ;
5152 if ( binaryFile == null ) return null ;
5253
53- var arguments = "--browser " + options . BrowserName + " --output json" ;
54- return RunCommand ( binaryFile , arguments ) ;
54+ StringBuilder argsBuilder = new StringBuilder ( ) ;
55+ argsBuilder . AppendFormat ( CultureInfo . InvariantCulture , " --browser \" {0}\" " , options . BrowserName ) ;
56+ argsBuilder . Append ( " --output json" ) ;
57+
58+ if ( ! string . IsNullOrEmpty ( options . BrowserVersion ) )
59+ {
60+ argsBuilder . AppendFormat ( CultureInfo . InvariantCulture , " --browser-version {0}" , options . BrowserVersion ) ;
61+ }
62+
63+ return RunCommand ( binaryFile , argsBuilder . ToString ( ) ) ;
5564 }
5665
5766 /// <summary>
@@ -68,7 +77,7 @@ private static string Binary
6877#else
6978 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
7079 {
71- binary = "selenium- manager/windows/selenium-manager.exe" ;
80+ binary = "C:/projects/seleniumhq/ selenium/common/ manager/windows/selenium-manager.exe" ;
7281 }
7382 else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
7483 {
You can’t perform that action at this time.
0 commit comments