How can I get the attribute value of an element with TestCafe?
Hi Emma,
To get the value of the attribute, you use the getAttribute() method as follows:
const link = document.querySelector('a');
let method = link.getAttribute('data-method');
How can I get the attribute value of an element with TestCafe?
Hi Emma,
To get the value of the attribute, you use the getAttribute() method as follows:
const link = document.querySelector('a');
let method = link.getAttribute('data-method');