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 / start-appium-nodes.sh
Created January 3, 2024 16:04
up appium nodes for Grid
#!/bin/bash
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/share:/opt/homebrew/share/android-sdk/tools:/opt/homebrew/share/android-sdk/platform-tools
pkill -f "java -jar selenium-server-"
pkill -f "appium"
# Function to create a .toml file for a given device
create_toml_file() {
@krishtoautomate
krishtoautomate / AppiumInstallation.txt
Last active January 2, 2024 19:14
Appium installation
# Install appium
npm i -g appium@latest
# Manage drivers
appium driver install xcuitest/uiautomator2
appium driver update xcuitest/uiautomator2
appium driver uninstall xcuitest/uiautomator2
@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..."