单击“跨越网格的跨距元素”不起作用。我尝试了操作,并在下面的代码下都无法正常工作。请指教。
async SaveorCancelRow() {
var table = this.component;
var tbody = table.element(by.xpath(".//tbody"));
var trs = tbody.all(by.tagName("tr")).get(1);
//Click Save tr[@class='SearchResultItemView customGridHighlight']//td[3]
await trs
.element(by.xpath('.//td[3]//span[contains(@class, "save")]'))
.click()
.then(function() {
browser.sleep(5000);
});
}
}
答案 0 :(得分:0)
尝试下面的简化代码。
async SaveorCancelRow() {
await this.component
.element(by.css('tbody > tr.SearchResultItemView > td > span.save'))
.click()
return await browser.sleep(5000);
}
}