Skip to content

Add TestBenchElement.getParent() #1887

@mvysny

Description

@mvysny

I need to figure out the label of a component when it's wrapped within a FormLayoutElement/FormItemElement. For that, I need to examine the component's parent. This function seems to do the trick:

    public static TestBenchElement getParent(TestBenchElement element) {
        final TestBenchElement parent = (TestBenchElement)
                element.getCommandExecutor().executeScript("return arguments[0].parentNode;", element.getWrappedElement());
        return parent;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done / Pending Release

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions