Skip to content

Commit 7b49207

Browse files
committed
Permit the target browser to be an empty string.
Some driver configurations do not check the browser string (appium?), but we still want to require it be set to something since it's part of the wire protocol. Fixes issue 8000.
1 parent 85e48ff commit 7b49207

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

javascript/node/selenium-webdriver/builder.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,10 @@ Builder.prototype.build = function() {
272272

273273
browser = capabilities.get(Capability.BROWSER_NAME);
274274

275-
if (!browser) {
276-
throw Error(
277-
'Target browser not defined; did you forget to call forBrowser()?');
275+
if (typeof browser !== 'string') {
276+
throw TypeError(
277+
'Target browser must be a string, but is <' + (typeof browser) + '>;' +
278+
' did you forget to call forBrowser()?');
278279
}
279280

280281
// Apply browser specific overrides.

0 commit comments

Comments
 (0)