public
Created

awesome

  • Download Gist
in callback
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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);
});
})
})

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.