Created
June 30, 2025 15:46
-
-
Save dennyabrain/67e00e3a1376cc02a69dfd66b9d94bc5 to your computer and use it in GitHub Desktop.
Launch Browsers using selenium and geckodriver binary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "selenium-vs", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"selenium-webdriver": "^4.33.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Builder, Browser, By, Key, until } = require('selenium-webdriver'); | |
async function launchBrowser(){ | |
let driver = await new Builder().forBrowser(Browser.FIREFOX).build() | |
await driver.get('http://localhost:4000/multiplayer/') | |
} | |
(async function example() { | |
try { | |
await launchBrowser() | |
await launchBrowser() | |
await launchBrowser() | |
await launchBrowser() | |
} finally { | |
// await driver.quit() | |
} | |
})()% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment