我试图获取元素属性data-id
的字符串值并将其存储到变量中
这样我就可以检查以确保data-id
等于下一页上加载的var dataId;
it('Should redirect to request details page, with the selected contract', function(done) {
driver.wait(until.elementLocated(by.xpath('//*[@id="contracts-list-panel"]/div[2]/div'))).click();
var element = driver.findElement(by.xpath('//*[@id="select-contract-modal"]/div[1]/div[2]/button'));
dataId = element.getAttribute("data-id").then(function(attr) {
expect(typeof attr).to.be.a("string");
console.log(dataId.toString());
element.click().then(function() {
driver.wait(until.elementLocated(by.id('request-new-signer-email'))).then(done());
});
});
});
。
**这是我的代码:
console.log
ManagedPromise::1356 {[[PromiseStatus]]: "pending"}
会返回此信息:
1)