From: Vasudevan C. <vco...@gm...> - 2017-02-01 17:59:54
|
Hi Ronald, I am calling http://www2.jobdiva.com/......URL after calling the add cookies. I have only the clojure snippet which I had copied. The clogo-data is the variable which has the Value for the cookie name COMPANYLOGOLOCATION. The same was working fine with HTMLUnit Version 2.15. I am just migrating the app to HTMLUnit 2.23 and found this issue Regards Vasu On 1 February 2017 at 23:20, Ronald Brill <rb...@rb...> wrote: > Hi Vasu, > > it will be really helpfull to provide all the detail you have. > > Regarding your question > * what is clogo-data? > * which url you are calling > > And it will really help to have complete plain java test cases to verify > your problems. > > Have added another test case that tries to simulate/reproduce your problem > > trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ > CookieManager2Test.java > @Test > @Alerts("my_name=my_data") > public void cookie_maxAgeMinusOne() throws Exception { > final WebClient webClient = getWebClient(); > final MockWebConnection webConnection = new MockWebConnection(); > > final URL url = URL_FIRST; > webConnection.setResponse(url, CookieManagerTest.HTML_ALERT_ > COOKIE); > webClient.setWebConnection(webConnection); > > final CookieManager mgr = webClient.getCookieManager(); > mgr.addCookie(new Cookie(URL_FIRST.getHost(), "my_name", > "my_data", "/", -1, false)); > > final List<String> collectedAlerts = new ArrayList<>(); > webClient.setAlertHandler(new CollectingAlertHandler( > collectedAlerts)); > > webClient.getPage(URL_FIRST); > assertEquals(getExpectedAlerts(), collectedAlerts); > } > > This test works for me. Please have a look - maybe there is a difference > for your case (or maybe the test did not work with your HtmlUnit version). > > > Hope that helps > > RBRi > > > > > On Wed, 1 Feb 2017 18:51:49 +0530 Vasudevan Comandur wrote: > > > >Hi, > > > > I am creating a set of cookies using the constructor of Cookie Object. > > Then I am adding those cookies into the cookieManager of a Webclient > > before sending a request to the site. > > > > When I looked into Charles WebProxy tool, I did not see those cookies > > set in the HTTP Cookie header. > > > > Whereas the same application was working fine with earlier version of > >HTMLUnit > > say 2.15. > > > > Am I missing something in HTMLUnit 2.23? > > Help needed urgently. > > > > Below is the clojure code snippet for reference: > > > > Creating a cookie > > val1= (new Cookie ".jobdiva.com" "COMPANYLOGOLOCATION" clogo-data "/" > -1 > >false) > > > > Adding cookie to Cookie Manager > > (.addCookie (.getCookieManager *wc*) val1) > > > > Please note *wc* is the WebClient Object. > > > > Appreciate your help. > > > >Regards > > Vasu > > > > > > > >----< Inline text [text-plain-04.txt] >------------------ > > > >----------------------------------------------------------- > ------------------- > >Check out the vibrant tech community on one of the world's most > >engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > > > >----< Inline text [text-plain-05.txt] >------------------ > > > >_______________________________________________ > >Htmlunit-user mailing list > >Htm...@li... > >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > |