html - Protractor - Selenium element Angular 2 Typescript -
ive got troubles getting text div has got class name , id, tried element(by.css('.panel-body')).gettext();<-return object objct element(by.classname('panel-body')).gettext();<-return object object element(by.id('message-body')).gettext();<-return object object element(by.xpath('//*[@id="message-body"]/text()[3]')).gettext()<-return textobject
there
html view, need link 0.0.0.0:3000 string, can me? thanks:)
use regular expression extract url:
element(by.css('#message-body')) .gettext() .then(text => text.match(/[^"\s]+\/student\/register\/\?[^"\s]+/)[0]) .then(url => console.log(url));
Comments
Post a Comment