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');
});
你有一个关于如何解决这个问题的想法?提前感谢您的回复!!