我如何从aria-rowcount获得价值,在量角器的页面上不可见

问题描述 投票:0回答:1

如何从aria-rowcount获得价值,我需要那517个价值。

我也附有图片<div class="dx-datagrid dx-gridbase-container" role="grid" aria-label="Data grid" aria-rowcount="517" aria-colcount="4">

async getNrOfTables() {
    console.log(' ### => Get the number of tables ');
    BrowserUtil.waitForElement(this.nrOfTables);
    await browser.sleep(2000);
    let j = this.nrOfTables.getAttribute('aria-rowcount')
     console.log(' ### => The number of tables ', j);
     return this;
}

enter image description here

protractor
1个回答
0
投票

尝试此解决方案以获取属性值

async getNrOfTables(){
//if you are using any waits then use here
let j = await this.nrOfTables.getAttribute('aria-rowcount');
console.log("Number of tables: " + j);
return j;
}
© www.soinside.com 2019 - 2024. All rights reserved.