We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aaa7e79 commit b49ae75Copy full SHA for b49ae75
javascript/node/selenium-webdriver/index.js
@@ -596,6 +596,17 @@ class Builder {
596
597
browser = capabilities.get(Capability.BROWSER_NAME)
598
599
+ /**
600
+ * If browser is not defined in forBrowser, check if browserOptions are defined to pick the browserName
601
+ */
602
+ if (!browser) {
603
+ const options =
604
+ this.chromeOptions_ || this.firefoxOptions_ || this.ieOptions_ || this.safariOptions_ || this.edgeOptions_
605
+ if (options) {
606
+ browser = options['map_'].get(Capability.BROWSER_NAME)
607
+ }
608
609
+
610
if (typeof browser !== 'string') {
611
throw TypeError(
612
`Target browser must be a string, but is <${typeof browser}>;` + ' did you forget to call forBrowser()?',
0 commit comments