Last active
August 29, 2015 14:15
-
-
Save deanhume/92c1a00edb5d379c27b4 to your computer and use it in GitHub Desktop.
Selenium running Node using Webdriver.io
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 webdriverio = require('webdriverio'); | |
var options = { | |
desiredCapabilities: { | |
browserName: 'firefox' | |
} | |
}; | |
webdriverio | |
.remote(options) | |
.init() | |
.url('http://www.bbc.co.uk/') // navigate to the web page | |
.setValue('#orb-search-q', ['surfing'], function(){}) // find the element and enter the query | |
.submitForm('#orb-search-form') // submit the form | |
.title(function(err, res) { | |
console.log('Title was: ' + res.value); // Confirm the page title | |
}) | |
.saveScreenshot('./snapshot.png') // Save the screenshot to disk | |
.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment