/** * * Returns the next sibling element of the selected DOM-element. * * :index.html

Sibling One

Sibling Two

Sibling Three

:nextElement.js it('should get text from next sibling element', async () => { const elem = await $$('p'); const nextElement = await elem[1].nextElement() console.log(await nextElement.getText()); // outputs: "Sibling Three" }); *
* * @alias element.nextElement * @return {WebdriverIO.Element} * @type utility */ export function nextElement (this: WebdriverIO.Element) { return this.$(/* istanbul ignore next */ function nextElement (this: HTMLElement) { return this.nextElementSibling as HTMLElement }) }