From: SourceForge.net <no...@so...> - 2006-11-28 19:30:15
|
Support Requests item #1604746, was opened at 2006-11-28 14:30 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448267&aid=1604746&group_id=47038 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ivan (ivanoc) Assigned to: Nobody/Anonymous (nobody) Summary: HTMLUnit and NTLM authentication Initial Comment: I'd like to use HTMLUnit to automate the testing of my web application. The first hurdle I've encountered is authentication. The web app uses jCIFS to provide NTLM authentication and this works fine from the browser. I've tried to use the DefaultCredentialsProvider to authenticate from a HTMLUnit test, so far without success. My code looks much like the code other people seem to be using successfully: public void testHomePageHTML() throws Exception { final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); webClient.setRedirectEnabled(true); DefaultCredentialsProvider cred = new DefaultCredentialsProvider(); // have also tried: // cred.addNTLMCredentials("user", "password", null, -1, "machineName", "domain"); cred.addNTLMCredentials("user", "password", null, -1, "", ""); webClient.setCredentialsProvider(cred); final URL url = new URL(MIPTT); final HtmlPage page = (HtmlPage)webClient.getPage(url); assertEquals("MIPTT Menu", page.getTitleText()); } Obviously, "user" and "password" are replaced with true values when I run the test. I've attached the log output - any insight would be greatly appreciated. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448267&aid=1604746&group_id=47038 |