Please assist me in setting up htmlunit with eclipse. I am tryning to fill a form and submit it through the code
Here is my code
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
public class Ullas {
public static void main(String[] args) {
WebClient client = new WebClient();
try
{
HtmlPage currentPage = (HtmlPage)client.getPage("http://xx.com");
HtmlForm form = (HtmlForm) CurrentPage.getElementById("login_form");
final HtmlTextInput textField = form.getInputByName("nm");
textField.setValueAttribute("mak");
final HtmlSubmitInput button = form.getInputByName("submitbutton");
//currentPage = form.getAcceptAttribute();
button.click();
}
catch(Exception ex)
{
System.out.println("Some form of error happened !");
}
}
}
I did included all the libraries but when I run the application it keeps on saying "the user operation is waiting for'building workspace' too complete"