Last active
January 4, 2016 01:08
-
-
Save dmitrym0/8545862 to your computer and use it in GitHub Desktop.
Timeout on text()
This file contains hidden or 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
require('colors'); | |
wd = require('wd'); | |
var browser = wd.promiseChainRemote('http://localhost:9515/'); | |
browser.on('status', function(info) { | |
console.log(info.cyan); | |
}); | |
browser.on('command', function(meth, path, data) { | |
console.log(' > ' + meth.yellow, path.green, data || ''); | |
}); | |
/* jshint evil: true */ | |
browser | |
.status() | |
.init({browserName:'chrome'}) | |
.get('http://dmitrym0.github.io/?epub=epub_content%2Flinear-algebra') | |
.sleep(3000) | |
.frame('epubContentIframe') | |
.elementsByTagName('p') | |
.then(function(elements){ | |
return elements[0].text() | |
}) | |
.then(function(text){ | |
console.log("TXT".red + text); | |
}) | |
.catch(function(err) { | |
console.log(err); | |
console.log(err.data); | |
}) | |
.done(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably your selenium setting.
This one is working https://gist.github.com/sebv/8547227