MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / getBinary

Function getBinary

javascript/selenium-webdriver/common/seleniumManager.js:37–61  ·  view source on GitHub ↗

* Determines the path of the correct Selenium Manager binary * @returns {string}

()

Source from the content-addressed store, hash-verified

35 * @returns {string}
36 */
37function getBinary() {
38 const directory = {
39 darwin: 'macos',
40 win32: 'windows',
41 cygwin: 'windows',
42 linux: 'linux',
43 }[platform]
44
45 const file = directory === 'windows' ? 'selenium-manager.exe' : 'selenium-manager'
46
47 let seleniumManagerBasePath = path.join(__dirname, '..', '/bin')
48
49 const filePath = process.env.SE_MANAGER_PATH || path.join(seleniumManagerBasePath, directory, file)
50
51 if (!fs.existsSync(filePath)) {
52 throw new Error(`Unable to obtain Selenium Manager at ${filePath}`)
53 }
54
55 if (!debugMessagePrinted) {
56 log_.debug(`Selenium Manager binary found at ${filePath}`)
57 debugMessagePrinted = true // Set the flag to true after printing the debug message
58 }
59
60 return filePath
61}
62
63/**
64 * Determines the path of the correct driver

Callers 1

binaryPathsFunction · 0.85

Calls 2

joinMethod · 0.80
debugMethod · 0.45

Tested by

no test coverage detected