Skip to content

Instantly share code, notes, and snippets.

@dennyabrain
Created June 30, 2025 15:46
Show Gist options
  • Save dennyabrain/67e00e3a1376cc02a69dfd66b9d94bc5 to your computer and use it in GitHub Desktop.
Save dennyabrain/67e00e3a1376cc02a69dfd66b9d94bc5 to your computer and use it in GitHub Desktop.
Launch Browsers using selenium and geckodriver binary
{
"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"
}
}
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