Aw: Re: Aw: Re: [Webtest] How To Debug Tests

Bit Byter webtest@lists.canoo.com
Tue, 5 Sep 2006 11:03:33 +0200 (CEST)


Hi Marc,

I'm now speaking only for the Maven WebTest plugin 1.5 as I'd like to use W=
ebTest with Maven:=20

I've added the ant option you mentioned to the Maven build.properties:

maven.webtest.ant.options=3D-DlogLevel.httpclientWire=3Ddebug

And all output I receive is:

webtest:test:
    [echo] Using the following ANT options : -DlogLevel.httpclientWire=3Dde=
bug
    [java] Buildfile: D:\webtest\SimpleTest.xml
    [java] Trying to override old definition of task sleep
    [java]
    [java] main:
    [java]
    [java] BUILD FAILED
    [java] D:\webtest\SimpleTest.xml:12: Canoo Webtest: R_1304.
    [java] Test failed.
    [java] Test step invoke (D:\webtest\SimpleTest.xml:15: )  named "get Lo=
gin Page" failed with message "Step[invoke "get
 Login Page" (1/2)]: HTTP error 404, at: invoke"
    [java]
    [java] Total time: 6 seconds


Seems like Log4j is not active.  :(
The log4j.jar is not within the lib folder of the plugin, but I expect it t=
o be loaded from the local Maven repository. By the way,  here is a snippet=
 of the log4j.properties:

## standard way of logging
log4j.rootCategory=3DDEBUG, stdout

## log debug information about connection calls
log4j.logger.com.canoo.webtest.steps.request=3Ddebug

log4j.logger.com.canoo.webtest.engine.Context=3Ddebug
log4j.logger.com.canoo.webtest.steps.pdftest=3Ddebug
log4j.logger.org.apache.commons.httpclient=3Ddebug

## log what htmlunit is doing, helpful to debug http header relay
log4j.logger.httpclient.wire=3Ddebug
log4j.logger.httpclient.wire.header=3Ddebug
log4j.logger.httpclient.wire.content=3Ddebug

## Settings for the Appender(s)
log4j.appender.stdout=3Dorg.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=3Dorg.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=3D%5p (%c) - %m%n

Any ideas?


----- Original Nachricht ----
Von:     Marc Guillemot <mguillemot@yahoo.fr>
An:      webtest@lists.canoo.com
Datum:   05.09.2006 10:14
Betreff: Re: Aw: Re: [Webtest] How To Debug Tests

> Hi,
>=20
> you can configure WebTest to use a proxy using Ant's setproxy task.
>=20
> To see what happens on the http wire, you can configure the=20
> httpclient.wire log to debug direct in log4j config file or by setting
> ANT_OPTS=3D"-DlogLevel.httpclientWire=3Ddebug"
> before calling your test script. This will allow you to see exactly what=
=20
> requests are made (inclusing headers) to the server.
>=20
> Marc.
>=20
> Bit Byter wrote:
> > Hi Paul,
> >=20
> > first thanks for your tips.
> >=20
> > Yes, the url=3D"/" works for the invoke tag.
> >=20
> > And yes, it's the log4j.properties file that was distributed with WebTe=
st
> (Plugin) in folder "${webtest.home}/classes", "$WEBTEST_HOME/lib"
> respectively in the standalone application.
> >=20
> > It's quite annoying having no possibility for debugging tests!  And in
> this case the received error message is not really helpful.  :(
> > Isn't there a way to configure an HTTP tunnel as proxy for WebTest?=20
> >=20
> > Greetings!
> >=20
> >=20
> > ----- Original Nachricht ----
> > Von:     Paul King <paulk@asert.com.au>
> > An:      webtest@lists.canoo.com
> > Datum:   05.09.2006 00:44
> > Betreff: Re: [Webtest] How To Debug Tests
> >=20
> >> Some suggestions:
> >>
> >> Does url=3D"/" work in the invoke?
> >>
> >> Is the log4j.properties you were modifying in
> path=3D"${webtest.home}/lib"?
> >>
> >> Cheers, Paul.
> >>
> >> Bit Byter wrote:
> >>> Hi WebTesters,
> >>>
> >>> I'm new to Canoo WebTest and just trying to get it run with Maven
> 1.1b2.
> >> So I installed the Maven WebTest Plugin from
> >>
> http://maven-plugins.sourceforge.net/maven-webtest-plugin/downloads.html.
> >>> I'm trying to run an adapted version of the simple SampleTest.xml fro=
m
> the
> >> Canoo website:
> >>>
> >>> <?xml version=3D"1.0" encoding=3D"UTF-8"?>
> >>> <!DOCTYPE project [
> >>>       <!ENTITY taskdef                                     SYSTEM
> >> "taskdef.xml">
> >>> ]>
> >>> <project name=3D"SimpleTest" basedir=3D"." default=3D"main">
> >>>
> >>>    &taskdef;
> >>>
> >>>    <target name=3D"main">
> >>>       <webtest name=3D"myTest">
> >>>          <config host=3D"127.0.0.1" port=3D"9090" protocol=3D"http"
> >> basepath=3D"/myapp" />
> >>>          <steps>
> >>>             <invoke description=3D"get Login Page" url=3D"login"
> >> method=3D"GET"/>
> >>>             <verifyTitle description=3D"we should see the login title=
"
> >> text=3D"Login Page" />
> >>>          </steps>
> >>>       </webtest>
> >>>    </target>
> >>> </project>
> >>>
> >>>
> >>> The included "taskdef" entity looks like this:
> >>>
> >>> <taskdef file=3D"${webtest.home}/webtestTaskdefs.properties">
> >>>     <classpath>
> >>>         <fileset dir=3D"${webtest.home}">
> >>>             <include name=3D"lib/*.jar"/>
> >>>             <include name=3D"lib/base/*.jar"/>
> >>>         </fileset>
> >>>         <pathelement path=3D"${webtest.home}/lib"/>
> >>>     </classpath>
> >>> </taskdef>
> >>>
> >>>
> >>> Now when I try to run the test by executing "maven webtest:test" I ge=
t
> the
> >> following error:
> >>> webtest:test:
> >>>     [java] Buildfile: D:\webtest\SimpleTest.xml
> >>>     [java] Trying to override old definition of task sleep
> >>>     [java]
> >>>     [java] main:
> >>>     [java]
> >>>     [java] BUILD FAILED
> >>>     [java] D:\webtest\SimpleTest.xml:11: Canoo Webtest: R_1304.
> >>>     [java] Test failed.
> >>>     [java] Test step invoke (D:\webtest\SimpleTest.xml:14: )  named
> "get
> >> Login Page" failed with message "Step[invoke "get
> >>>  Login Page" (1/2)]: HTTP error 404, at: invoke"
> >>>     [java]
> >>>     [java] Total time: 8 seconds
> >>>
> >>>
> >>> I've verified that the web server is running and the configured URL i=
s
> >> available by requesting it successfully in a browser. Thus I assume th=
e
> test
> >> is trying request a different website.
> >>> The received error message does not really help to find the error. I'=
ve
> >> tried enabling all the loggers in log4j.properties, but unfortunately
> those
> >> seem not to work.
> >>> So how to debug such an error? Is there a possibility to configure an
> HTTP
> >> tunnel as WebTest proxy? Any help is appreciated!
> >>> - BitByter
> >>>
> >>> Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonier=
en
> >>> ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor:
> >> g=FCnstig
> >>> und schnell mit DSL - das All-Inclusive-Paket f=FCr clevere
> Doppel-Sparer,
> >>> nur  44,85 ?  inkl. DSL- und ISDN-Grundgeb=FChr!
> >>> http://www.arcor.de/rd/emf-dsl-2
> >>> _______________________________________________
> >>> WebTest mailing list
> >>> WebTest@lists.canoo.com
> >>> http://lists.canoo.com/mailman/listinfo/webtest
> >>>
> >>>
> >> _______________________________________________
> >> WebTest mailing list
> >> WebTest@lists.canoo.com
> >> http://lists.canoo.com/mailman/listinfo/webtest
> >>
> >=20
> > Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
> > ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor:
> g=FCnstig
> > und schnell mit DSL - das All-Inclusive-Paket f=FCr clevere Doppel-Spar=
er,
> > nur  44,85 ?  inkl. DSL- und ISDN-Grundgeb=FChr!
> > http://www.arcor.de/rd/emf-dsl-2
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> >=20
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20

Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g=FCnsti=
g
und schnell mit DSL - das All-Inclusive-Paket f=FCr clevere Doppel-Sparer,
nur  44,85 =80  inkl. DSL- und ISDN-Grundgeb=FChr!
http://www.arcor.de/rd/emf-dsl-2