Skip to content

Commit 778cf32

Browse files
committed
[javascript] Using SM to check drivers on the PATH
JS part of #11356
1 parent a27e97c commit 778cf32

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
*/
2323

2424
const { driverLocation } = require('./seleniumManager')
25-
const fs = require('fs')
2625

2726
/**
2827
* Determines the path of the correct Selenium Manager binary
2928
* @returns {string}
3029
*/
3130
function getPath(service, capabilities) {
3231
try {
33-
return pathExists(service.getExecutable()) || driverLocation(capabilities)
32+
return driverLocation(capabilities)
3433
} catch (e) {
3534
throw Error(
3635
`Unable to obtain browser driver.
@@ -40,20 +39,5 @@ function getPath(service, capabilities) {
4039
}
4140
}
4241

43-
/**
44-
* _Synchronously_ attempts to locate the driver executable on the current
45-
* system.
46-
*
47-
* @param {!string} driverPath
48-
*
49-
* @return {?string} the located executable, or `null`.
50-
*/
51-
function pathExists(driverPath) {
52-
if (!driverPath || !fs.existsSync(driverPath)) {
53-
return null
54-
}
55-
return driverPath
56-
}
57-
5842
// PUBLIC API
5943
module.exports = { getPath }

0 commit comments

Comments
 (0)