Skip to content

element.scrollIntoView

element.scrollIntoView(scrollableArea?: DOMElement): Promise<void>

Section titled “element.scrollIntoView(scrollableArea?: DOMElement): Promise<void>”

Scrolls the current DOM element into view within a scrollable area. If the scrollable area is not provided, the method attempts to locate the first scrollable parent element in the DOM hierarchy.

  • scrollableArea: (Default = null) The scrollable area in which the element should be scrolled into view.
  • Returns a promise that resolves when the action is complete.
describe('Test script', function () {
it('Test 1', async () => {
const element = await gf.get('.my-button');
await element.scrollIntoView();
});
});