Results 1 to 9 of 9
  1. #1
    Char's Avatar
    Char is offline Member
    Join Date
    Dec 2009
    Posts
    41
    Rep Power
    0

    Default Creating cookie ? also JWebUnit

    first of all, im telling you what i want to do:

    1) give my program a page to go to and i want it to save some information to database.

    2) i have the database working, im using HSQLDB, now i have a script that takes all information(source code) from html and makes it as a string

    3) the problem is, when my script goes to website it isn't allowed to see certain content and it always throws me to login page. even when i browse for example in chrome or IE and im logged in to site. when i go with java script, then it is never logged in.

    4) so i think i need to make some cookies with java, meaning that java logs in the site and then takes the source code of certain pages.

    my script for taking source code from page:

    Java Code:
    import java.io.BufferedReader;
        import java.io.InputStreamReader;
        import java.io.IOException;
        
        import java.net.HttpURLConnection;
        import java.net.MalformedURLException;
        import java.net.URL;
        
    public class HtmlReader {
        
    	private String address;
            
    	public HtmlReader(String address) {
    		this.address = address;
    	}
    
    	public String readHtml() {
    		StringBuffer html = new StringBuffer();
    		try {
    			URL url = new URL(address);
    			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    			BufferedReader br = new BufferedReader(
    			new InputStreamReader(conn.getInputStream()));
    			String line;
    			
    			while ((line = br.readLine()) != null) {
    				html.append(line);
    			}
    			br.close();
    		} catch (MalformedURLException mue){
    			System.out.println(mue.getMessage());
    		} catch (IOException ioe) {
    			System.out.println(ioe.getMessage());
    		}
    		return html.toString();			
    	}
    
    	public static void main(String[] args) {
    		if (args.length == 1) {
    			HtmlReader hr = new HtmlReader(args[0]);
    			String html = hr.readHtml();
    			System.out.println(html);
    		} else {
    			System.out.println("usage: java HtmlReader url");
    		}
    	}
    }

    all i need now, is how to make cookie for logging in.. i googled and stuff but i am not sure where to start. all i need it to do is to log in with my username and pw..and active my script
    Last edited by Char; 12-24-2010 at 10:43 PM.

  2. #2
    Char's Avatar
    Char is offline Member
    Join Date
    Dec 2009
    Posts
    41
    Rep Power
    0

    Default

    okay i started using a thing called HttpClient..


    Java Code:
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.UsernamePasswordCredentials;
    import org.apache.commons.httpclient.auth.AuthScope;
    import org.apache.commons.httpclient.methods.GetMethod;
    
    public class HttpTest {
        
        /**
         * Constructor for BasicAuthenticatonExample.
         */
        public HttpTest() {
            super();
        }
        
        public static void main(String[] args) throws Exception {
            HttpClient client = new HttpClient();
            
            // pass our credentials to HttpClient, they will only be used for
            // authenticating to servers with realm "realm" on the host
            // "www.verisign.com", to authenticate against an arbitrary realm 
            // or host change the appropriate argument to null.
            client.getState().setCredentials(
                    new AuthScope("http://pokerrpg.com", 443, "realm"),
                    new UsernamePasswordCredentials("username", "password")
                    );
            
            // create a GET method that reads a file over HTTPS, 
            // we're assuming that this file requires basic 
            // authentication using the realm above.
            GetMethod get = new GetMethod(
                    "https://http://pokerrpg.com/furniture_store.php");
            
            // Tell the GET method to automatically handle authentication. The
            // method will use any appropriate credentials to handle basic
            // authentication requests.  Setting this value to false will cause
            // any request for authentication to return with a status of 401.
            // It will then be up to the client to handle the authentication.
           get.setDoAuthentication( true );
            
            try {
                // execute the GET
                int status = client.executeMethod( get );
                
                // print the status and response
                System.out.println(status + "\n" + 
                        get.getResponseBodyAsString());
                
            } finally {
                // release any connection resources used by the method
                get.releaseConnection();
            }
        }
    }

    well i'm testing out this code with a browser based game. PokerRPG .
    i got this code from google and it kinda of works, well it does print all the source code, but the problem is that, it take the source code of the main site, so apparently it does not log in? any suggestions ?

  3. #3
    Char's Avatar
    Char is offline Member
    Join Date
    Dec 2009
    Posts
    41
    Rep Power
    0

    Default

    okay, seems like noone has experience with such specific and advanced stuff. so ill try using jwebunit

    i downloaded it and im trying to get the first example code to work, but i have no idea what im doing wrong.
    i did as it told me :
    JWebUnit - Installation
    ...make sure you add the jwebunit-htmlunit-plugin-XX.jar, jwebunit-core-XX.jar and all HtmlUnit dependencies (these files are in lib/ folder of the JWebUnit package) to your classpath in your IDE.
    i did this as you can see from left...why it still gives me error? i googeled it, but i seem to have done everything
    im using this tutorial, the first code example
    JWebUnit - Quick Start



  4. #4
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    you need junit.jar, from junit.org too

  5. #5
    Char's Avatar
    Char is offline Member
    Join Date
    Dec 2009
    Posts
    41
    Rep Power
    0

    Default

    Quote Originally Posted by bmn_115 View Post
    Just curious, but why do you need a script to simply download the source for a web page? Seems like an awful lot of work for just that.
    well because in a certain time there will be on an update on this web page.. and i need to get new information from it within few seconds..so only thing i could think of, was making a program for it..so it :

    1) takes source code to string
    2) finds certain stuff from string
    3) adds/compares it with database
    4) makes actions accordingly

  6. #6
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    could not use the http header for last modified time on the request, which would cause the server to return a 304 not modified response if the content has not changed since you last looked?

    e.g. HTTP 304: Not Modified — Anne’s Blog

    and HTTP/1.1: Status Code Definitions

  7. #7
    Char's Avatar
    Char is offline Member
    Join Date
    Dec 2009
    Posts
    41
    Rep Power
    0

    Default

    So anyways:

    now i trying to get mu jwebunit to work and i've run into next problem.
    Java Code:
    import net.sourceforge.jwebunit.junit.WebTestCase;
    
    
    
    public class JWeb extends WebTestCase {
    	
    	 public void setUp() throws Exception {
    		 super.setUp();
    		 setBaseUrl("http://www.google.com");
    	 }
    	 public void testIndexLogin() {
    		 assertEquals("hi", "hi");
    
    	 }
    	 public void testOne() {
                     beginAt("/");
    		 assertTitleEquals("Home");     
    	 }
    }
    Java Code:
    00:49:40.977 [main] DEBUG c.g.htmlunit.WebClient - Get page for window named '', using WebRequest[<url="http://www.google.com/", GET, EncodingType[name=application/x-www-form-urlencoded], [], {Accept=*/*}, null>]
    00:49:40.989 [main] DEBUG c.g.htmlunit.WebClient - Load response for GET http://www.google.com/
    00:49:41.263 [main] DEBUG o.a.h.i.c.t.ThreadSafeClientConnManager - ThreadSafeClientConnManager.getConnection: HttpRoute[{}->http://www.google.com], timeout = 0
    00:49:41.265 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Total connections kept alive: 0
    00:49:41.265 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Total issued connections: 0
    00:49:41.266 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Total allocated connection: 0 out of 20
    00:49:41.266 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - No free connections [HttpRoute[{}->http://www.google.com]][null]
    00:49:41.266 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Available capacity: 2 out of 2 [HttpRoute[{}->http://www.google.com]][null]
    00:49:41.266 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Creating new connection [HttpRoute[{}->http://www.google.com]]
    00:49:41.353 [main] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: compatibility
    00:49:41.364 [main] DEBUG o.a.h.impl.client.DefaultHttpClient - Attempt 1 to execute request
    00:49:41.364 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Sending request: GET / HTTP/1.1
    00:49:41.364 [main] DEBUG org.apache.http.wire - >> "GET / HTTP/1.1[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.wire - >> "Host: www.google.com[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.wire - >> "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.wire - >> "Accept-Language: en-us[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.wire - >> "Accept: */*[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.wire - >> "[EOL]"
    00:49:41.366 [main] DEBUG org.apache.http.headers - >> GET / HTTP/1.1
    00:49:41.366 [main] DEBUG org.apache.http.headers - >> Host: www.google.com
    00:49:41.367 [main] DEBUG org.apache.http.headers - >> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
    00:49:41.367 [main] DEBUG org.apache.http.headers - >> Accept-Language: en-us
    00:49:41.367 [main] DEBUG org.apache.http.headers - >> Accept: */*
    00:49:41.367 [main] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
    00:49:41.409 [main] DEBUG org.apache.http.wire - << "HTTP/1.1 302 Found[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Location: http://www.google.ee/[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Cache-Control: private[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Content-Type: text/html; charset=UTF-8[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Set-Cookie: PREF=ID=567977130f505e6b:FF=0:TM=1293230986:LM=1293230986:S=dfxpPEOW70cfqwhX; expires=Sun, 23-Dec-2012 22:49:46 GMT; path=/; domain=.google.com[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Set-Cookie: NID=42=VMoyXWY-qWrzqt0q1-_n5vPfUtJuoYNmhJCdY4fBNahcthAgfCK8pLgrOjxZHE0fOrMWdVma_Qh0iLiMrAJP6tqb4aQ5R7KVuEaMB0wIjskVXJgV_6PdDxCJnoMoh46k; expires=Sat, 25-Jun-2011 22:49:46 GMT; path=/; domain=.google.com; HttpOnly[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Date: Fri, 24 Dec 2010 22:49:46 GMT[EOL]"
    00:49:41.412 [main] DEBUG org.apache.http.wire - << "Server: gws[EOL]"
    00:49:41.413 [main] DEBUG org.apache.http.wire - << "Content-Length: 218[EOL]"
    00:49:41.413 [main] DEBUG org.apache.http.wire - << "X-XSS-Protection: 1; mode=block[EOL]"
    00:49:41.413 [main] DEBUG org.apache.http.wire - << "[EOL]"
    00:49:41.414 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 302 Found
    00:49:41.414 [main] DEBUG org.apache.http.headers - << HTTP/1.1 302 Found
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Location: http://www.google.ee/
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Cache-Control: private
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Content-Type: text/html; charset=UTF-8
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Set-Cookie: PREF=ID=567977130f505e6b:FF=0:TM=1293230986:LM=1293230986:S=dfxpPEOW70cfqwhX; expires=Sun, 23-Dec-2012 22:49:46 GMT; path=/; domain=.google.com
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Set-Cookie: NID=42=VMoyXWY-qWrzqt0q1-_n5vPfUtJuoYNmhJCdY4fBNahcthAgfCK8pLgrOjxZHE0fOrMWdVma_Qh0iLiMrAJP6tqb4aQ5R7KVuEaMB0wIjskVXJgV_6PdDxCJnoMoh46k; expires=Sat, 25-Jun-2011 22:49:46 GMT; path=/; domain=.google.com; HttpOnly
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Date: Fri, 24 Dec 2010 22:49:46 GMT
    00:49:41.414 [main] DEBUG org.apache.http.headers - << Server: gws
    00:49:41.415 [main] DEBUG org.apache.http.headers - << Content-Length: 218
    00:49:41.415 [main] DEBUG org.apache.http.headers - << X-XSS-Protection: 1; mode=block
    00:49:41.432 [main] DEBUG o.a.h.c.p.ResponseProcessCookies - Cookie accepted: "[version: 0][name: PREF][value: ID=567977130f505e6b:FF=0:TM=1293230986:LM=1293230986:S=dfxpPEOW70cfqwhX][domain: .google.com][path: /][expiry: Mon Dec 24 00:49:46 EET 2012]". 
    00:49:41.433 [main] DEBUG o.a.h.c.p.ResponseProcessCookies - Cookie accepted: "[version: 0][name: NID][value: 42=VMoyXWY-qWrzqt0q1-_n5vPfUtJuoYNmhJCdY4fBNahcthAgfCK8pLgrOjxZHE0fOrMWdVma_Qh0iLiMrAJP6tqb4aQ5R7KVuEaMB0wIjskVXJgV_6PdDxCJnoMoh46k][domain: .google.com][path: /][expiry: Sun Jun 26 01:49:46 EEST 2011]". 
    00:49:41.434 [main] DEBUG o.a.h.impl.client.DefaultHttpClient - Connection can be kept alive indefinitely
    00:49:41.437 [main] DEBUG org.apache.http.wire - << "<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">[\n]"
    00:49:41.437 [main] DEBUG org.apache.http.wire - << "<TITLE>302 Moved</TITLE></HEAD><BODY>[\n]"
    00:49:41.437 [main] DEBUG org.apache.http.wire - << "<H1>302 Moved</H1>[\n]"
    00:49:41.437 [main] DEBUG org.apache.http.wire - << "The document has moved[\n]"
    00:49:41.437 [main] DEBUG org.apache.http.wire - << "<A HREF="http://www.google.ee/">here</A>.[\r][\n]"
    00:49:41.437 [main] DEBUG org.apache.http.wire - << "</BODY></HTML>[\r][\n]"
    00:49:41.438 [main] DEBUG o.a.h.i.c.t.ThreadSafeClientConnManager - Released connection is reusable.
    00:49:41.438 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://www.google.com]][null]
    00:49:41.438 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://www.google.com]][null]; keep alive for -1 MILLISECONDS
    00:49:41.438 [main] DEBUG o.a.h.i.conn.IdleConnectionHandler - Adding connection at: 1293230981438
    00:49:41.439 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Notifying no-one, there are no waiting threads
    00:49:41.450 [main] DEBUG c.g.htmlunit.WebClient - Got a redirect status code [302] new location = [http://www.google.ee/]
    00:49:41.451 [main] DEBUG c.g.htmlunit.WebClient - Load response for GET http://www.google.ee/
    00:49:41.451 [main] DEBUG o.a.h.i.c.t.ThreadSafeClientConnManager - ThreadSafeClientConnManager.getConnection: HttpRoute[{}->http://www.google.ee], timeout = 0
    00:49:41.451 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Total connections kept alive: 1
    00:49:41.451 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Total issued connections: 0
    00:49:41.452 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Total allocated connection: 1 out of 20
    00:49:41.452 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - No free connections [HttpRoute[{}->http://www.google.ee]][null]
    00:49:41.452 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Available capacity: 2 out of 2 [HttpRoute[{}->http://www.google.ee]][null]
    00:49:41.452 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Creating new connection [HttpRoute[{}->http://www.google.ee]]
    00:49:41.492 [main] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: compatibility
    00:49:41.493 [main] DEBUG o.a.h.impl.client.DefaultHttpClient - Attempt 1 to execute request
    00:49:41.493 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Sending request: GET / HTTP/1.1
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "GET / HTTP/1.1[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "Host: www.google.ee[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "Accept-Language: en-us[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "Accept: */*[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.wire - >> "[EOL]"
    00:49:41.493 [main] DEBUG org.apache.http.headers - >> GET / HTTP/1.1
    00:49:41.494 [main] DEBUG org.apache.http.headers - >> Host: www.google.ee
    00:49:41.494 [main] DEBUG org.apache.http.headers - >> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
    00:49:41.494 [main] DEBUG org.apache.http.headers - >> Accept-Language: en-us
    00:49:41.494 [main] DEBUG org.apache.http.headers - >> Accept: */*
    00:49:41.494 [main] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
    00:49:41.553 [main] DEBUG org.apache.http.wire - << "HTTP/1.1 200 OK[EOL]"
    00:49:41.554 [main] DEBUG org.apache.http.wire - << "Date: Fri, 24 Dec 2010 22:49:46 GMT[EOL]"
    00:49:41.554 [main] DEBUG org.apache.http.wire - << "Expires: -1[EOL]"
    00:49:41.554 [main] DEBUG org.apache.http.wire - << "Cache-Control: private, max-age=0[EOL]"
    00:49:41.554 [main] DEBUG org.apache.http.wire - << "Content-Type: text/html; charset=UTF-8[EOL]"
    00:49:41.554 [main] DEBUG org.apache.http.wire - << "Set-Cookie: PREF=ID=fac6d0ce5b03f8ef:FF=0:TM=1293230986:LM=1293230986:S=p_DZR1n8yhKbtqG4; expires=Sun, 23-Dec-2012 22:49:46 GMT; path=/; domain=.google.ee[EOL]"
    00:49:41.566 [main] DEBUG org.apache.http.wire - << "Set-Cookie: NID=42=exDmFh5VksXgdmEx50Gz0OaF1KAh8i1SV0TmbapweVEMO_-0RzAPBCMLmetydnwmrCN3fyWcG69oI9yqdcmvM6EYYAM92k1YcZL6v52eUwLrWWDMLII4BRSR7O0Ueyz7; expires=Sat, 25-Jun-2011 22:49:46 GMT; path=/; domain=.google.ee; HttpOnly[EOL]"
    00:49:41.566 [main] DEBUG org.apache.http.wire - << "Server: gws[EOL]"
    00:49:41.566 [main] DEBUG org.apache.http.wire - << "X-XSS-Protection: 1; mode=block[EOL]"
    00:49:41.566 [main] DEBUG org.apache.http.wire - << "Transfer-Encoding: chunked[EOL]"
    00:49:41.566 [main] DEBUG org.apache.http.wire - << "[EOL]"
    00:49:41.566 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
    00:49:41.566 [main] DEBUG org.apache.http.headers - << HTTP/1.1 200 OK
    00:49:41.566 [main] DEBUG org.apache.http.headers - << Date: Fri, 24 Dec 2010 22:49:46 GMT
    00:49:41.566 [main] DEBUG org.apache.http.headers - << Expires: -1
    00:49:41.566 [main] DEBUG org.apache.http.headers - << Cache-Control: private, max-age=0
    00:49:41.566 [main] DEBUG org.apache.http.headers - << Content-Type: text/html; charset=UTF-8
    00:49:41.566 [main] DEBUG org.apache.http.headers - << Set-Cookie: PREF=ID=fac6d0ce5b03f8ef:FF=0:TM=1293230986:LM=1293230986:S=p_DZR1n8yhKbtqG4; expires=Sun, 23-Dec-2012 22:49:46 GMT; path=/; domain=.google.ee
    00:49:41.567 [main] DEBUG org.apache.http.headers - << Set-Cookie: NID=42=exDmFh5VksXgdmEx50Gz0OaF1KAh8i1SV0TmbapweVEMO_-0RzAPBCMLmetydnwmrCN3fyWcG69oI9yqdcmvM6EYYAM92k1YcZL6v52eUwLrWWDMLII4BRSR7O0Ueyz7; expires=Sat, 25-Jun-2011 22:49:46 GMT; path=/; domain=.google.ee; HttpOnly
    00:49:41.567 [main] DEBUG org.apache.http.headers - << Server: gws
    00:49:41.567 [main] DEBUG org.apache.http.headers - << X-XSS-Protection: 1; mode=block
    00:49:41.567 [main] DEBUG org.apache.http.headers - << Transfer-Encoding: chunked
    00:49:41.569 [main] DEBUG o.a.h.c.p.ResponseProcessCookies - Cookie accepted: "[version: 0][name: PREF][value: ID=fac6d0ce5b03f8ef:FF=0:TM=1293230986:LM=1293230986:S=p_DZR1n8yhKbtqG4][domain: .google.ee][path: /][expiry: Mon Dec 24 00:49:46 EET 2012]". 
    00:49:41.570 [main] DEBUG o.a.h.c.p.ResponseProcessCookies - Cookie accepted: "[version: 0][name: NID][value: 
    ..................................................
    ....................................................
    "ogle.ac.i(form,form.q,'','','',{o:1,sw:1});} catch(e) {google.ml(e, false, {'cause': 'defer'});}google.med&&google.med('init');google.History&&google.History.initialize('/')});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);google.fade=null;}</script></div><script>(function(){[\n]"
    00:49:41.633 [main] DEBUG org.apache.http.wire - << "var b,d,e,f;function g(a,c){if(a.removeEventListener){a.removeEventListener("load",c,false);a.removeEven"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "tListener("error",c,false)}else{a.detachEvent("onload",c);a.detachEvent("onerror",c)}}function h(a){f=(new Date).getTime();++d;a=a||window.event;var c=a.target||a.srcElement;g(c,h)}var i=document.getElementsByTagName("img");b=i.length;d=0;for(var j=0,k;j<b;++j){k=i[j];if(k.complete||typeof k.src!="string"||!k.src)++d;else if(k.addEventListener){k.addEventListener("load",h,false);k.addEventListener("error",[\n]"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "h,false)}else{k.attachEvent("onload",h);k.attachEvent("onerror",h)}}e=b-d;function l(){if(!google.timers.load.t)return;google.timers.load.t.ol=(new Date).getTime();google.timers.load.t.iml=f;google.kCSI.imc=d;google.kCSI.imn=b;google.kCSI.imp=e;google.timers.load.t.xjs&&google.report&&google.report(google.timers.load,google.kCSI)}if(window.addEventListener)window.addEventListener("load",l,false);else if(window.attachEvent)window.attachEvent("onload",l);google.timers.load.t.prt=(f=(new Date).getTime());[\n]"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "})();[\n]"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "</script>"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "[\r]"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "[\n]"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "0[EOL]"
    00:49:41.634 [main] DEBUG org.apache.http.wire - << "[EOL]"
    00:49:41.634 [main] DEBUG o.a.h.i.c.t.ThreadSafeClientConnManager - Released connection is reusable.
    00:49:41.634 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Releasing connection [HttpRoute[{}->http://www.google.ee]][null]
    00:49:41.634 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Pooling connection [HttpRoute[{}->http://www.google.ee]][null]; keep alive for -1 MILLISECONDS
    00:49:41.635 [main] DEBUG o.a.h.i.conn.IdleConnectionHandler - Adding connection at: 1293230981634
    00:49:41.635 [main] DEBUG o.a.h.i.conn.tsccm.ConnPoolByRoute - Notifying no-one, there are no waiting threads
    00:49:41.717 [main] DEBUG c.g.htmlunit.WebWindowImpl - setEnclosedPage: HtmlPage(http://www.google.ee/)@300402123
    00:49:41.717 [main] DEBUG c.g.htmlunit.WebWindowImpl - destroyChildren
    00:49:42.183 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.css.CSSPrimitiveValue
    00:49:42.267 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.css.CSSValue
    00:49:42.293 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.DOMException
    00:49:42.314 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.DOMParser
    00:49:42.354 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCanvasElement
    00:49:42.501 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.MimeType
    00:49:42.517 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.OfflineResourceList
    00:49:42.517 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.Plugin
    00:49:42.549 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument
    00:49:42.564 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest
    00:49:42.564 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest
    00:49:42.564 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLSerializer
    00:49:42.564 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.XPathNSResolver
    00:49:42.564 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.XPathResult
    00:49:42.700 [main] DEBUG c.g.htmlunit.util.EncodingSniffer - Encoding found in HTTP headers: 'UTF-8'.
    00:49:42.718 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject
    00:49:42.720 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.ClipboardData
    00:49:42.720 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.css.CSSPrimitiveValue
    00:49:42.747 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.css.CSSValue
    00:49:42.748 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.DOMException
    00:49:42.748 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.DOMParser
    00:49:42.750 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.Enumerator
    00:49:42.753 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.External
    00:49:42.756 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLAudioElement
    00:49:42.758 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCanvasElement
    00:49:42.792 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLSourceElement
    00:49:42.802 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.html.HTMLVideoElement
    00:49:42.803 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.MimeType
    00:49:42.805 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.Namespace
    00:49:42.806 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.NamespaceCollection
    00:49:42.807 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.OfflineResourceList
    00:49:42.808 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.Plugin
    00:49:42.808 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.Popup
    00:49:42.811 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.TextRange
    00:49:42.814 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument
    00:49:42.815 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDOMParseError
    00:49:42.815 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest
    00:49:42.816 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest
    00:49:42.816 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.xml.XMLSerializer
    00:49:42.816 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.XPathNSResolver
    00:49:42.816 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.XPathResult
    00:49:42.816 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - browser tag not yet handled for class com.gargoylesoftware.htmlunit.javascript.host.XSLTemplate
    00:49:42.817 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlInsertedText to HTMLInsElement
    00:49:42.818 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlDirectory to HTMLDirectoryElement
    00:49:42.818 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlTitle to HTMLTitleElement
    00:49:42.818 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlFieldSet to HTMLFieldSetElement
    00:49:42.819 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlButton to HTMLButtonElement
    00:49:42.820 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlSelect to HTMLSelectElement
    00:49:42.820 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlAnchor to HTMLAnchorElement
    00:49:42.822 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlTextArea to HTMLTextAreaElement
    00:49:42.822 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomDocumentFragment to DocumentFragment
    00:49:42.822 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlEmbed to HTMLEmbedElement
    00:49:42.823 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomComment to Comment
    00:49:42.824 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlBaseFont to HTMLBaseFontElement
    00:49:42.824 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlElement to HTMLElement
    00:49:42.824 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlOptionGroup to HTMLOptGroupElement
    00:49:42.824 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlHorizontalRule to HTMLHRElement
    00:49:42.825 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlOption to HTMLOptionElement
    00:49:42.825 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlMenu to HTMLMenuElement
    00:49:42.826 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlUnknownElement to HTMLUnknownElement
    00:49:42.826 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomCharacterData to CharacterDataImpl
    00:49:42.827 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlImage to HTMLImageElement
    00:49:42.827 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlTableCell to HTMLTableCellElement
    00:49:42.829 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlFrame to HTMLFrameElement
    00:49:42.829 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlInput to HTMLInputElement
    00:49:42.829 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlFont to HTMLFontElement
    00:49:42.830 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlDeletedText to HTMLDelElement
    00:49:42.830 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlInlineFrame to HTMLIFrameElement
    00:49:42.831 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomCDataSection to CDATASection
    00:49:42.831 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlMeta to HTMLMetaElement
    00:49:42.832 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlCaption to HTMLTableCaptionElement
    00:49:42.832 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlDefinitionList to HTMLDListElement
    00:49:42.832 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlFrameSet to HTMLFrameSetElement
    00:49:42.832 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlTableRow to HTMLTableRowElement
    00:49:42.832 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlSource to HTMLSourceElement
    00:49:42.833 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlStyle to HTMLStyleElement
    00:49:42.833 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomProcessingInstruction to ProcessingInstruction
    00:49:42.834 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomElement to Element
    00:49:42.834 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.DomAttr to Attr
    00:49:42.836 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlScript to HTMLScriptElement
    00:49:42.836 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlHtml to HTMLHtmlElement
    00:49:42.836 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlHead to HTMLHeadElement
    00:49:42.836 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlBase to HTMLBaseElement
    00:49:42.836 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlParameter to HTMLParamElement
    00:49:42.837 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlParagraph to HTMLParagraphElement
    00:49:42.837 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlOrderedList to HTMLOListElement
    00:49:42.837 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlAudio to HTMLAudioElement
    00:49:42.837 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlCanvas to HTMLCanvasElement
    00:49:42.838 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlListItem to HTMLLIElement
    00:49:42.838 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlMap to HTMLMapElement
    00:49:42.838 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlSpacer to HTMLSpacerElement
    00:49:42.838 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlLabel to HTMLLabelElement
    00:49:42.838 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlBreak to HTMLBRElement
    00:49:42.839 [main] DEBUG c.g.h.j.c.JavaScriptConfiguration - Mapping com.gargoylesoftware.htmlunit.html.HtmlLegend to HTMLLegendElement
    ..............................
    ...............................


    testing basicallyworks but its giving me this output, which lags and takes tons of time and is extremelly annoying


    seems like jwebunit logging level is set to debug, how i can change it to info ? i googled and stuff, still did not find

  8. #8
    Char's Avatar
    Char is offline Member
    Join Date
    Dec 2009
    Posts
    41
    Rep Power
    0

    Default

    wait, what?

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Abuse reported on user Java Forums - View Profile: Jaione

    4 posts, all of which are a copy/paste repeat of another post higher up in the thread.

    db

Similar Threads

  1. Setting domain of cookie
    By mintyzzz in forum Java Servlet
    Replies: 1
    Last Post: 10-23-2010, 04:29 AM
  2. Remove cookie
    By erakhman in forum Java Servlet
    Replies: 1
    Last Post: 08-09-2010, 11:16 AM
  3. Cookie value is appending with some other unknown characters
    By soujanya in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-26-2010, 11:11 AM
  4. Browser Cookie Access
    By OrangeDog in forum Java Applets
    Replies: 1
    Last Post: 04-28-2009, 04:44 AM
  5. Setting cookie from doPost
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-25-2008, 07:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •