* @throws DuplicateClientIDException if more than one client ID matches the suffix
* @throws ClassCastException if the current page is not an HtmlPage.
*/
public Element getElement(String componentID)
{
DomNode domPage = (DomNode)getContentPage();
String xpathQuery = buildXPathQuery(componentID);
List elements = domPage.getByXPath(xpathQuery);
if (elements.size() == 0) return null;
if (elements.size() == 1) return (Element)elements.get(0);
Element exactMatch = findExactMatch(elements, componentID);
if (exactMatch != null) return exactMatch;
throw new DuplicateClientIDException(elements, componentID);