@@ -85,7 +85,7 @@ public static async Task<SeleniumStandaloneServer> GetInstanceAsync(ITestOutputH
8585 private static async Task InitializeInstance ( ITestOutputHelper output )
8686 {
8787 var port = FindAvailablePort ( ) ;
88- var uri = new UriBuilder ( "http" , SeleniumHost , port ) . Uri ;
88+ var uri = new UriBuilder ( "http" , SeleniumHost , port , "/wd/hub" ) . Uri ;
8989
9090 var seleniumConfigPath = typeof ( SeleniumStandaloneServer ) . Assembly
9191 . GetCustomAttributes < AssemblyMetadataAttribute > ( )
@@ -100,33 +100,22 @@ private static async Task InitializeInstance(ITestOutputHelper output)
100100 // In AzDO, the path to the system chromedriver is in an env var called CHROMEWEBDRIVER
101101 // We want to use this because it should match the installed browser version
102102 // If the env var is not set, then we fall back on using whatever is in the Selenium config file
103+ var chromeDriverArg = string . Empty ;
103104 var chromeDriverPathEnvVar = Environment . GetEnvironmentVariable ( "CHROMEWEBDRIVER" ) ;
104105 if ( ! string . IsNullOrEmpty ( chromeDriverPathEnvVar ) )
105106 {
107+ chromeDriverArg = $ "--javaArgs=-Dwebdriver.chrome.driver={ chromeDriverPathEnvVar } /chromedriver";
106108 output . WriteLine ( $ "Using chromedriver at path { chromeDriverPathEnvVar } ") ;
107- var chromeDriverVersion = new ProcessStartInfo
108- {
109- FileName = chromeDriverPathEnvVar ,
110- Arguments = "--version" ,
111- RedirectStandardOutput = true ,
112- RedirectStandardError = true ,
113- } ;
114- Process . Start ( chromeDriverVersion ) . WaitForExit ( ) ;
115109 }
116110
117111 var psi = new ProcessStartInfo
118112 {
119113 FileName = "npm" ,
120- Arguments = $ "run selenium-standalone start -- --config \" { seleniumConfigPath } \" -- -- host { SeleniumHost } - -port { port } ",
114+ Arguments = $ "run selenium-standalone start -- --config \" { seleniumConfigPath } \" { chromeDriverArg } -- -host { SeleniumHost } -port { port } ",
121115 RedirectStandardOutput = true ,
122116 RedirectStandardError = true ,
123117 } ;
124118
125- if ( ! string . IsNullOrEmpty ( chromeDriverPathEnvVar ) )
126- {
127- psi . EnvironmentVariables [ "PATH" ] = $ "{ psi . EnvironmentVariables [ "PATH" ] } { Path . PathSeparator } { chromeDriverPathEnvVar } ";
128- }
129-
130119 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
131120 {
132121 psi . FileName = "cmd" ;
0 commit comments