【发布时间】:2020-03-26 18:10:17
【问题描述】:
我正在尝试使用I.grabAttributeFrom() 方法获取元素的属性值,但我总是得到未定义而不是属性值。我的代码是
Scenario('Smoketest', async (I) => {
const columnIndex = await I.grabAttributeFrom('//th[text()="Status"]', 'aria-colindex');
});
元素是这样的
<th aria-colindex = "2">
"Status"
<span> ... </span>
</th>
我在 codeceptjs 中使用 testcafe。
【问题讨论】:
-
我把你的选择器改成了
th,还是不行。我调试了testcafe模块,它按预期工作:返回值2。问题可能出在codeceptjs方面。在他们的 github 存储库中报告它是有意义的。 -
感谢您向我确认这不是 testcafe 问题。我会检查 codeceptjs github repo。
-
修复已合并。现在等待下一个(2.4.0)版本。感谢发现错误
-
欢迎。我会检查下一个版本:)
标签: testing attributes automated-tests testcafe codeceptjs