element.getPositionOnScreen
element.getPositionOnScreen(): Promise<{ x: number, y: number } | null>
Section titled “element.getPositionOnScreen(): Promise<{ x: number, y: number } | null>”Retrieves the position of the element on the screen.
- Returns a promise that resolves to an object containing the
x
andy
coordinates of the element on the screen. - If the element is not visible, the method returns
null
.
describe('Test script', function () { it('Test 1', async () => { const element = await gf.get('.my-element'); const position = await element.getPositionOnScreen(); });});