Skip to content

Commit

Permalink
Permit the target browser to be an empty string.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jleyba committed Oct 8, 2014
1 parent 85e48ff commit 7b49207
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions javascript/node/selenium-webdriver/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,10 @@ Builder.prototype.build = function() {

browser = capabilities.get(Capability.BROWSER_NAME);

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

// Apply browser specific overrides.
Expand Down

0 comments on commit 7b49207

Please sign in to comment.