@@ -201,10 +201,21 @@ export class WebOSDriver extends BaseDriver {
201
201
}
202
202
203
203
204
+ /**
205
+ * @typedef BrowserVersionInfo
206
+ * @property {string } Browser
207
+ * @property {string } Protocol-Version
208
+ * @property {string } User-Agent
209
+ * @property {string } V8-Version
210
+ * @property {string } WebKit-Version
211
+ * @property {string } webSocketDebuggerUrl
212
+ */
213
+
204
214
/**
205
215
* Use UserAgent info for "Browser" if the chrome response did not include
206
216
* browser name properly.
207
- * @param {object } browserVersionInfo
217
+ * @param {BrowserVersionInfo } browserVersionInfo
218
+ * @return {BrowserVersionInfo }
208
219
*/
209
220
useUAForBrowserIfNotPresent ( browserVersionInfo ) {
210
221
if ( ! _ . isEmpty ( browserVersionInfo . Browser ) ) {
@@ -222,6 +233,7 @@ export class WebOSDriver extends BaseDriver {
222
233
}
223
234
224
235
log . info ( `The response did not have Browser, thus set the Browser value from UA as ${ JSON . stringify ( browserVersionInfo ) } ` ) ;
236
+ // @ts -ignore isEmpty already checked as null.
225
237
browserVersionInfo . Browser = chromeVersion [ 0 ] ;
226
238
return browserVersionInfo ;
227
239
}
@@ -258,9 +270,13 @@ export class WebOSDriver extends BaseDriver {
258
270
259
271
// To respect the executableDir.
260
272
executable = undefined ;
273
+
274
+ if ( _ . isEmpty ( result . Browser ) ) {
275
+ this . log . info ( `No browser version info was available. If no proper chromedrivers exist in ${ executableDir } , the session creation will fail.` ) ;
276
+ }
261
277
} catch ( err ) {
262
278
throw new errors . SessionNotCreatedError (
263
- `Could not get the chrome browser information to detect proper chromedriver version. Is it a debiggable build? Error: ${ err . message } `
279
+ `Could not get the chrome browser information to detect proper chromedriver version. Is it a debuggable build? Error: ${ err . message } `
264
280
) ;
265
281
}
266
282
}
0 commit comments