downloading files behind javascript button with htmlunit
I am trying to download something an attachment behind a javascript button with HtmlUnit. Performing other tasks works great (eg. navigating, login). I checked out the attachment unit test but it didnt help me. final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24); final HtmlPage page1 = webClient.getPage( loginUrl ); final HtmlTextInput textField = page1.getElementByName(user); final HtmlPasswordInput pwd = page1.getElementByName(pwd); textField.setValueAttribute(User.getUsername()); pwd.setValueAttribute(User.getPassword()); final HtmlSubmitInput button = page1