Skip to content

Instantly share code, notes, and snippets.

@dmitrym0
Last active January 4, 2016 01:08
Show Gist options
  • Save dmitrym0/8545862 to your computer and use it in GitHub Desktop.
Save dmitrym0/8545862 to your computer and use it in GitHub Desktop.
Timeout on text()
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();
@sebv
Copy link

sebv commented Jan 21, 2014

Probably your selenium setting.

This one is working https://gist.github.com/sebv/8547227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment