java - HtmlUnit (junit) me is returning an error in the code -


first clarified using google translator. hispanic. not english

well, said need do

i'm trying make code work gives me error, note putting same ta @ official website:: official website: http://htmlunit.sourceforge.net/gettingstarted.html

package serieflv; import org.junit.test; import com.gargoylesoftware.htmlunit.webclient; import com.gargoylesoftware.htmlunit.html.htmlpage; import junit.framework.assert;        public class webclient {             @test             public void homepage() throws exception {                 final webclient webclient = new webclient();                 try (final webclient webclient = new webclient()) {                     final htmlpage page =    webclient.getpage("http://htmlunit.sourceforge.net");                     assert.assertequals("htmlunit - welcome htmlunit", page.gettitletext());                      final string pageasxml = page.asxml();                     assert.asserttrue(pageasxml.contains("<body class=\"composite\">"));                      final string pageastext = page.astext();                     assert.asserttrue(pageastext.contains("support http , https protocols"));                 }             }         }  

these errors launches these errors launches

you seem have have incorrectly imported junit 3 class here while test case junit 4 test case.

have following line

import junit.framework.assert; 

modified to

import org.junit.assert; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -