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

Sibling One

Sibling Two

Sibling Three

:parentElement.js it('should get class from parent element', async () => { const elem = await $$('p'); const parent = await elem[2].parentElement() console.log(await parent.getAttribute('class')); // outputs: "parent" }); *
* * @alias element.parentElement * @return {WebdriverIO.Element} * @type utility */ export function parentElement (this: WebdriverIO.Element) { return this.$(/* istanbul ignore next */ function parentElement (this: HTMLElement) { return this.parentElement as HTMLElement }) }