2010-01-12 5 views
0

java HtmlUnit lib를 테스트하십시오. webclient 객체에서 사용하는 쿠키 파일 (cookiejar)을 설정/삭제하는 방법이 있는지 알아 내려고합니다.htmlunit 쿠키/질문을 참조하십시오

HtmlUnit API뿐만 아니라 여러 문서를 검색 했으므로 내가 뭔가 빠졌다고 가정하면. 또한

, 내 테스트 기간 동안 클라이언트/서버 사이 xfered되는 헤더 (요청/respnse/리퍼러)를 볼 수있는 방법이 ...

감사

답변

0

당신이 할 수있는 webClient.getCookieManager()을 사용하고 HttpWebConnection의 하위 클래스를 다음과 같이 지정할 수 있습니다.

webClient.setWebConnection(new HttpWebConnection(webClient) { 
     public WebResponse getResponse(WebRequestSettings settings) throws IOException { 
      System.out.println(settings.getUrl()); 
      return super.getResponse(settings); 
     } 
    });