@Test
public void hasNameTest() {

    Path el = div.that(hasName("abc"));
    NodeList nodes = findAllByXpath("<div name=\"abc\" class=\"a\">x</div><div name=\"abcd\" class=\"b\">x</div><div class=\"c\">x</div><div name=\"abc\" class=\"d\">x</div>", el);
    assertThat(nodes.getLength(), is(2));
    assertThat(getCssClass(nodes.item(0)), is("a"));
    assertThat(getCssClass(nodes.item(1)), is("d"));
    assertThat(el.toString(), is(equalTo("div, that has name: \"abc\"")));
}