missing submit button
Brought to you by:
dgan
I'm just getting started here, so be patient with me.
What constitutes a submit button?
I've got HTML like this:
<button name="fred" type="submit" TABINDEX="3"
CLASS="button">OK
</button>
I'm using this code to retrieve it -- I'm getting NO submit
buttons.
wc=DefaultWebFactory.getFactory().newWebClient
();
wc.openPage
("http://localhost:8080/crmWeb/test.crm");
WebResponse currentPage = wc.getCurrentState();
WebForm logonForm = currentPage.getForms()[0];
SubmitButton[] buttons =
logonForm.getSubmitButtons();
System.out.println("number of buttons [" +
buttons.length + "]");
Thanks in advance,
Erik Ostermueller
erik.ostermueller@alltel.com
Logged In: YES
user_id=180587
Here is the printTree dump from my button:
WebTag: name:null tag:BUTTON
nativeID:tagname=BUTTON,index=0,href=http://localhost:8080
/crmWeb/test.crm Atrs:type=submit name=fred tabindex=3
class=button
Logged In: YES
user_id=180587
I found a way around this:
In DefaultWebClient.java,
private static DefaultWebTag genTag(HTMLNode el,
RuntimeHandler rh)
throws RemoteException
I added a clause to treat BUTTON tags
just like INPUT tags. Here is the code I added:
else if (tagName.equalsIgnoreCase("BUTTON"))
{
childTag= createInput(el,rh);
}