我试图获取一个元素并检查它是否显示。我收到此错误: 无法找到带有css选择器'徽标'
的元素这是我的代码:
describe("Homepage", function () {
var ptor;
beforeEach(function() {
ptor = protractor.getInstance();
});
it("Check visibility of elements", function() {
//Go to homepage
ptor.get('/#');
//Check elements that should be visible:
//Logo
expect($('logo').isDisplayed()).toBeTruthy();
var logo = ptor.findElement(protractor.By.id('logo'));
expect(logo.isDisplayed()).toEqual(true);
});
});
我在index.html中的一行有这个ID,如下所示:
<div id="logo" class="title ligatures">BuddyCheck</div>
我做错了什么?谢谢!