@Test(expected=IllegalArgumentException.class)
public void invalidRelationTest() {

    Path path = div.that(hasAncesctor(new BasicPath.PathBuilder().withUnderlying(mock(WebElement.class)).build()));
    path.getXPath();
}