Skip to content

Instantly share code, notes, and snippets.

@admc
Created January 28, 2012 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save admc/1693709 to your computer and use it in GitHub Desktop.
Save admc/1693709 to your computer and use it in GitHub Desktop.
awesome
var assert = require('assert')
, jellyfish = require('jellyfish');
var browser = jellyfish.createWebdriver();
// browser.opts.browserName = "iexplore";
// browser.opts.version = "9";
browser.on('result', function(res) {
console.log(browser.name + ' : '+browser.tid + ' - \x1b[33m%s\x1b[0m', JSON.stringify(res));
});
browser.go("http://www.wikipedia.com",
function() {
browser.js("document.title")
.js("document.getElementById(\'searchInput\').value = \'test\'")
.js("document.getElementById(\'searchInput\').value")
.js("document.getElementsByName(\'go\')[0].click()")
.jsfile("../stub/example_file.js", function(o) {
browser.stop(function() {
setTimeout(process.exit, 2000);
});
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment