2015-09-11 62 views
2

我是量角器的新手,想要獲得'ng-disabled'返回的值,以便我可以使用該值進一步操作。當我嘗試使用getAttribute()獲取值時,它不會返回任何值。量角器 - 如何使用量角器檢索'ng-disabled'的值

element.all(by.css('[ng-disabled="campaign.reportStatus"]')).getAttribute('value').then(function (result) { 
console.log('result is' +result); 
}); 

請爲我提供解決方案。在此先感謝...

+0

你試圖得到什麼樣的價值?請發佈您的html代碼和任何更多的細節,你想分享。 –

回答

4

你必須使用getAttribute('disabled')獲得禁用狀態。

element(by.css('button')).getAttribute('disabled')).then(function (result) { 
console.log('result is' +result); 
});