From: Craig H. <cr...@as...> - 2002-07-09 17:36:35
|
HtmlArea question... I'm trying this: final HtmlArea iconRS = (HtmlArea)page.getOneHtmlElementByAttribute("area","onclic","popWin('/servle t/com.ashlandagency.everbase.admin.GenServlet?object=Search&xslFile=begi nSearch.xsl&lastName=','search','750','470','no','yes','yes','yes','yes' ,'no','no','no');"); I'm assuming that you need the elementName,attributeName, and attributeValue in that order. Is this correct? --------------------------------------------- But when I run it I'm getting the ElementNotFoundException... --------------------------------------------- I can see in your HtmlElement.java that if the list.size() equals 0 the exception is thrown... public final HtmlElement getOneHtmlElementByAttribute( final String elementName, final String attributeName, final String attributeValue ) throws ElementNotFoundException { assertNotNull( "elementName", elementName ); assertNotNull( "attributeName", attributeName ); assertNotNull( "attributeValue", attributeValue ); final List list = getHtmlElementsByAttribute( elementName, attributeName, attributeValue ); final int listSize = list.size(); if( listSize == 0 ) { throw new ElementNotFoundException( elementName, attributeName, attributeValue ); } else if( listSize > 1 ) { throw new IllegalStateException( "Found more than one matching element" ); } return ( HtmlElement )list.get( 0 ); } -------------------------- Craig Hickman Sr. Software Engineer 624 A St Ashland OR, 97520 541.488.0801 Direct 541.488.0807 Fax --------------------------- Ashland Agency the e-web company www.ashlandagency.com *************** Only in the unreal can we be saved. Reality ruins everything and everyone. ------ Thomas Ligotti |