mardi 4 septembre 2018

How to create checkbox element in htmlunit?

I am trying to use the createElement method explained in the following link:

http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/html/InputElementFactory.html#createElement-com.gargoylesoftware.htmlunit.SgmlPage-java.lang.String-org.xml.sax.Attributes-

For this I am trying to use the following code:

HtmlPage page = webClient.getPage("http://...");
HtmlCheckBoxInput checkBox = (HtmlCheckBoxInput) page.createElement("checkbox");

But the createElement method returns an HtmlUnknownElement object. How can I create the checkbox element?

The following code is working while creating an input text element:

HtmlElement tmpCheckBox = (HtmlElement) pageClientInput.createElement("input");




Aucun commentaire:

Enregistrer un commentaire