Empty response in Protractor console.log

时光毁灭记忆、已成空白 提交于 2019-12-11 15:43:23

问题


I have done very basic script in protractor cucumber framework and use Chai and Chai as Promised as assert libraries.

browser.get('http://www.angularjs.org');

 var elm = element(by.id('the-basics'));
        elm.getText().then(function(txt) {
            console.log("txt: " + txt);
        });

But, I cannot see anything is written in terminal.

I tried with xpath as well and get the same empty response.

var elm = element(by.id('//h3[@id='the-basics']'));
            elm.getText().then(function(txt) {
                console.log("txt: " + txt);
            });

Have I done anything wrong here?

来源:https://stackoverflow.com/questions/52658462/empty-response-in-protractor-console-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!