Skip to content

Commit da9a4fb

Browse files
committed
[JS] Print debug message once for each browser when selenium manager used
1 parent b9f0938 commit da9a4fb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

javascript/node/selenium-webdriver/common/seleniumManager.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const spawnSync = require('child_process').spawnSync
3232
*/
3333
const Browser = ['chrome', 'firefox', 'edge', 'MicrosoftEdge', 'iexplorer']
3434

35+
let debugMessagePrinted = {};
36+
3537
/**
3638
* Determines the path of the correct Selenium Manager binary
3739
* @returns {string}
@@ -71,9 +73,14 @@ function driverLocation(options) {
7173
)
7274
}
7375

74-
console.debug(
75-
'Applicable driver not found; attempting to install with Selenium Manager (Beta)'
76-
)
76+
const browserName = options.getBrowserName().toLocaleLowerCase();
77+
78+
if (!debugMessagePrinted[browserName]) {
79+
console.debug(
80+
`Applicable driver not found for ${browserName}; attempting to install with Selenium Manager (Beta)`
81+
)
82+
debugMessagePrinted[browserName] = true; // Set the flag to true after printing the debug message
83+
}
7784

7885
let args = ['--browser', options.getBrowserName(), '--output', 'json']
7986

0 commit comments

Comments
 (0)