element.getAttribute
element.getAttributes(): Promise<Object>
Section titled “element.getAttributes(): Promise<Object>”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'); });});