elements.last
elements.last(): Promise<DOMElement>
Section titled “elements.last(): Promise<DOMElement>”Retrieves the last element in the array.
- Returns a promise that resolves to the last
DOMElement
instance in the array. - If the array is empty, the method throws an error.
describe('Test script', function () { it('Test 1', async () => { const elements = await gf.getAll('.my-elements'); const element = await elements.last(); });});