Last active
August 29, 2015 14:02
-
-
Save akshay-bhardwaj/57817b7e731f5f468e38 to your computer and use it in GitHub Desktop.
This file contains 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
var webdriver = require('selenium-webdriver'); | |
var http = require('http'); | |
var globalTunnel = require('global-tunnel'); | |
globalTunnel.initialize({ | |
host: 'localhost', // set proxy ip or hostname | |
port: 9091, // set proxy port | |
sockets: 50 // optional pool size for each http and https | |
}); | |
// Input capabilities | |
var capabilities = { | |
'browserName' : 'firefox', | |
'browserstack.user' : '<username>', | |
'browserstack.key' : '<userkey>' | |
} | |
var driver = new webdriver.Builder(). | |
usingServer('http://hub.browserstack.com/wd/hub'). | |
withCapabilities(capabilities). | |
build(); | |
driver.get('http://www.google.com/ncr'); | |
driver.findElement(webdriver.By.name('q')).sendKeys('BrowserStack'); | |
driver.findElement(webdriver.By.name('btnG')).click(); | |
driver.getTitle().then(function(title) { | |
console.log(title); | |
}); | |
driver.quit(); | |
console.log("Going to quit the script: " + code.toString()); | |
globalTunnel.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment