[Java] 测试,HttpUnit →→→→→进入此内容的聊天室

来自 , 2020-03-29, 写在 Java, 查看 141 次.
URL http://www.code666.cn/view/b56a18e0
  1. /**
  2.          * 直接获取网页内容
  3.          * @throws IOException
  4.          * @throws SAXException
  5.          */
  6.         @Test
  7.         public void testhttp() throws IOException, SAXException{
  8.                 System.out.println("直接获取网页内容。。。。");
  9.                
  10.                 WebConversation wc = new WebConversation();
  11.                
  12.                 WebResponse wr = wc.getResponse("http://localhost:8006/TestUnitils/index.jsp");
  13.                
  14.                 System.out.println(wr.getText());
  15.                 assertTrue(wr.getTitle().startsWith("测试"));
  16.  
  17.         }

回复 "测试,HttpUnit"

这儿你可以回复上面这条便签

captcha