【发布时间】:2016-11-28 21:14:40
【问题描述】:
我正在使用protractor 编写测试,我的目标是单击一个元素并检查它是否具有特定的class。问题是我使用的是click(),然后是then(),但出现以下错误:
Cannot read property 'getAttribute' of null
问题位于以下代码块中:
element(by.css('#region1 polygon:first-child')).click()
.then(function(selected){
expect(selected.getAttribute('class')).toContain('highlighted');
});
您知道如何解决这个问题吗?提前感谢您的回复!
【问题讨论】:
标签: javascript jasmine protractor end-to-end