2
我正在寫一個測試protractor
,我的目的是點擊一個元素,並檢查它是否有特定的class
。問題是,我使用click()
,其次是then()
,但我收到以下錯誤:Click()然後()不起作用 - 量角器
Cannot read property 'getAttribute' of null
問題位於下面的代碼塊:
element(by.css('#region1 polygon:first-child')).click()
.then(function(selected){
expect(selected.getAttribute('class')).toContain('highlighted');
});
你有一個關於如何解決這個問題的想法?提前感謝您的回覆!!