Skip to content

element.getAttribute

Retrieves the value of the specified attribute of the element.

  • name: The name of the attribute to retrieve.
  • Returns a promise that resolves to the value of the attribute or null if the attribute does not exist.
describe('Test script', function () {
it('Test 1', async () => {
const element = await gf.get('.my-element');
const attribute = await element.getAttribute('data-id');
});
});