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...

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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -