How to log an element using protractor? -
i'm trying locate element using protractor can't find it. debug, i'd @ element did find , see 1 is. have code this:
myelement.all(by.csscontainingtext('.name', 'value')).then(function (elems) { console.log(elems.length); <--- line logs "2" console.log(elems[1]); <--- line logs "{ ptor_: ...." elems[1].getinnerhtml().then(function(html){ console.log(html); <--- never gets here }); }); how can see elements all() method found?
not sure if it's best/most concise way, should able use map loop on elements, , use getouterhtml() on each access html
myelement.all(by.csscontainingtext('.name', 'value')).map(function(el) { return el.getouterhtml(); }).then(function(html) { console.log(html); });
Comments
Post a Comment