I am trying to get attribute value of an element by using I.grabAttributeFrom() method but I always get undefined instead of attribute value. My codes are
Scenario(‘Smoketest’, async (I) => {
.
.
.
const columnIndex = await I.grabAttributeFrom(’//th[text()=“Status”]’, ‘aria-colindex’);
.
.
});
The element is like that
<th aria-colindex = "2">
"Status"
<span> ... </span>
</th>
And I am using testcafe.