Skip to content

Instantly share code, notes, and snippets.

@SergeyAvd
SergeyAvd / openDebugger.ahk
Created October 27, 2017 20:00
Hit F12 to open DevTools debugger for Xulrunner (Firefox/Gecko) based application. Pre-req: installed Firefox, opened application
SetTitleMatchMode, 2
ConnectFirefox()
{
WinActivate Mozilla Firefox
Send, {Alt}
Send, T
Send, W
Send, C
While !WinExist("Connect - Mozilla Firefox")
@SergeyAvd
SergeyAvd / test_grid.html
Created September 18, 2017 23:07
An html page to demostrate a chromedriver click issue on zoom levels other than 100%
<html>
<head>
<title>test grid page</title>
</head>
<style>
body {
width:1000px;
}
* {
box-sizing: border-box;
@SergeyAvd
SergeyAvd / use_existing_chromedriver.js
Created March 3, 2017 17:27
Connect to an existing chromedriver on port 9515
const {Builder, By, until, Capabilities} = require('selenium-webdriver');
// Make sure `chromedriver --port=9515` was started before
var driver = new Builder()
.withCapabilities(Capabilities.chrome())
.usingServer('http://localhost:9515')
.build();
driver.get('http://www.google.com/ncr')
.then(_ => driver.findElement(By.name('q')).sendKeys('webdriver'))
@SergeyAvd
SergeyAvd / useRunningBrowser.js
Created February 6, 2017 21:48
Basic example modified to use an already running Chrome browser
// google_search.js
var chromeDriver = require('chromedriver'), // Auto install ChromeDriver
webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var chrome = require("selenium-webdriver/chrome");
var options = new chrome.Options();
options.options_["debuggerAddress"] = "127.0.0.1:6813";
var driver = new webdriver.Builder()
@SergeyAvd
SergeyAvd / useProvidedExecutable.js
Created February 6, 2017 19:49
Basic example modified to use specified executable
// google_search.js
var chromeDriver = require('chromedriver'), // Auto install ChromeDriver
webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var path = 'C:\\Users\\savdeev\\Downloads\\chrome-win32\\chrome-win32\\chrome.exe';
var chrome = require("selenium-webdriver/chrome");
var driver = new webdriver.Builder()
.forBrowser('chrome')