Skip to content

Instantly share code, notes, and snippets.

View krishtoautomate's full-sized avatar

krishtoautomate krishtoautomate

View GitHub Profile
@krishtoautomate
krishtoautomate / Java
Created August 26, 2024 12:24 — forked from akashdktyagi/Java
Use of Selenium Dev Tools CDP to modify header of the request- add authorization token
URL gridUrl = new URL("url");
EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.setPlatformName(String.valueOf(Platform.LINUX));
edgeOptions.addArguments("no-sandbox");
// EdgeDriver driver = new EdgeDriver(edgeOptions);
EdgeDriver driver = new EdgeDriver();
// RemoteWebDriver driver = new RemoteWebDriver(gridUrl);
DevTools devTools = driver.getDevTools();
devTools.createSession();
@krishtoautomate
krishtoautomate / selenium-grid.sh
Created March 20, 2022 18:33 — forked from techwhizbang/selenium-grid.sh
Selenium Grid service script
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium-grid.pid
then
echo "Selenium Grid is already running."
else
java -jar /home/bkr/selenium/selenium-server-standalone-2.9.0.jar -port 5555 -role hub > /var/log/selenium/selenium-grid.log 2> /var/log/selenium/selenium-grid-error.log & echo $! > /tmp/selenium-grid.pid
echo "Starting Selenium Grid..."