Hi drmike,
I am not getting any sort of error. Instead of sending request to particular page, server redirects request internally to login page. Following is the sample code that i wrote. For this I am using HttpUnit.
WebConversation wc = new WebConversation();
ClientProperties clProp = ClientProperties.getDefaultProperties();
clProp.setAcceptGzip(true);
clProp.setAutoRedirect(true);
clProp.setAcceptCookies(true);
HttpUnitOptions.setExceptionsThrownOnScriptError(false);
HttpUnitOptions.setLoggingHttpHeaders(true);
WebRequest request = new PostMethodWebRequest("http://wordpress.com");
WebResponse response = wc.getResponse( request );
WebForm loginForm = response.getFormWithName("loginForm");
request = loginForm.getRequest();
System.out.print("Action : " + loginForm.getAction());
request.setParameter("log","username");
request.setParameter("pwd","password");
response = loginForm.submit();
// find the link which contains the string "My Dashboard" and click it
/*
WebLink httpunitLink = response.getFirstMatchingLink( WebLink.MATCH_CONTAINED_TEXT, "My Dashboard" );
response = httpunitLink.click();
*/
System.out.println("****** " + response.getResponseCode());
System.out.println("****** " + response.getText());
when i run this code, it returns response as main login page instead of the page that i want. when i give wrong username and password it returns as expected "invalid login" page. But when i give correct username and password it returns main login page as response, that is unexpected, it should return dashboard page.
Thanks,
Sadashiv