[HtmlUnit] [htmlunit:bugs] #1962 FormSubmission not working - for log in
RBRi via HtmlUnit-develop <[email protected]>
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | </p/htmlunit/bugs/1962/50e7bd7b2743b3318c8a1c2c11fbce982fc3f342.bugs@htmlunit.p.sourceforge.net> |
- **status**: accepted --> pending
---
** [bugs:#1962] FormSubmission not working - for log in**
**Status:** pending
**Group:** 2.30
**Labels:** input form submission
**Created:** Fri May 11, 2018 04:13 PM UTC by Flake
**Last Updated:** Sun May 27, 2018 08:15 AM UTC
**Owner:** RBRi
I cannot get form submission to work on a login form. I've wasted hours and tried everything but there's no improvement whatsoever.
I've successfully used form submission for a search field - that worked as expected.
But for the login form HtmlUnit just does not seem to POST at all. Or it does and I do not manage to get the correct page.
I correctly retrieve the form and input elements.
I've tried setting the inputs (HtmlTextInput and HtmlPasswordInput) via `type()`, `setValueAttribbute()` and `setNodeValue()`.
I've tried submitting the form via getting the correct submit element and calling `page = submit.click();`, calling `page = (HtmlPage) username.type('\n');` and same for the password field.
I've tried getting the correct page by assigning the return value from `click()`, `type()` and also via `webClient.getCurrentWindow().getEnclosedPage()`. I also checked all windows - there were two but the second didn't seem to have a page ...
I've also waited for ages via `waitForBackgroundJavaScript()` and the other one as well as `Thread.sleep()` and have also tried the `NicelyResynchronizingAjaxController`.
I've tried `webClient.getOptions().setRedirectEnabled(true)` and `getCache().setMaxSize(0)`;
The page I try to log in to is this: https://www.dtad.de
When output the page I can see that the URL is still the root URL and that the input fields have the values that I set. So either the page wasn't submitted or I'm on the wrong page. The form action is what it's supposed to be (...validate.do). But here comes the even weirder thing:
When I try to log in via https://www.dtad.de/login I get the bad credentials message after form submit. So submission seems to work. But when I log in via the root page I should be forwarded to https://www.dtad.de/login (when entering bad credentials) but that does NOT happen. `page.asXml()` outputs the exact root page but with the input values set.
I'm really deperate and exhausted. I hope you can spot the mistake.
I've also checked if http -> https makes a difference but it ain't.
Best,
Flake
---
Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/htmlunit/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop