Last active
July 14, 2016 20:22
-
-
Save simpleprogrammer-shared/d77039b4691c56aaa49c9e2362aa61b7 to your computer and use it in GitHub Desktop.
Selenium With Node.js and Mocha: Automated Testing With JavaScript 2
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 assert = require('assert'), | |
test = require('selenium-webdriver/testing'), | |
webdriver = require('selenium-webdriver'); | |
test.describe('Google Search', function() { | |
test.it('should work', function() { | |
var driver = new webdriver.Builder(). | |
withCapabilities(webdriver.Capabilities.chrome()). | |
build(); | |
driver.get('http://www.google.com'); | |
var searchBox = driver.findElement(webdriver.By.name('q')); | |
searchBox.sendKeys('simple programmer'); | |
searchBox.getAttribute('value').then(function(value) { | |
assert.equal(value, 'simple programmer'); | |
}); | |
driver.quit(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment