Hi Marc,
I'm now speaking only for the Maven WebTest plugin 1.5 as I'd like to use
WebTest with Maven:
I've added the ant option you mentioned to the Maven build.properties:
maven.webtest.ant.options=-DlogLevel.httpclientWire=debug
And all output I receive is:
webtest:test:
[echo] Using the following ANT options : -DlogLevel.httpclientWire=debug
[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 Login
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 to be
loaded from the local Maven repository. By the way, here is a snippet of the
log4j.properties:
## standard way of logging
log4j.rootCategory=DEBUG, stdout
## log debug information about connection calls
log4j.logger.com.canoo.webtest.steps.request=debug
log4j.logger.com.canoo.webtest.engine.Context=debug
log4j.logger.com.canoo.webtest.steps.pdftest=debug
log4j.logger.org.apache.commons.httpclient=debug
## log what htmlunit is doing, helpful to debug http header relay
log4j.logger.httpclient.wire=debug
log4j.logger.httpclient.wire.header=debug
log4j.logger.httpclient.wire.content=debug
## Settings for the Appender(s)
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p (%c) - %m%n
Any ideas?
----- Original Nachricht ----
Von: Marc Guillemot <[EMAIL PROTECTED]>
An: [email protected]
Datum: 05.09.2006 10:14
Betreff: Re: Aw: Re: [Webtest] How To Debug Tests
> Hi,
>
> you can configure WebTest to use a proxy using Ant's setproxy task.
>
> To see what happens on the http wire, you can configure the
> httpclient.wire log to debug direct in log4j config file or by setting
> ANT_OPTS="-DlogLevel.httpclientWire=debug"
> before calling your test script. This will allow you to see exactly what
> requests are made (inclusing headers) to the server.
>
> Marc.
>
> Bit Byter wrote:
> > Hi Paul,
> >
> > first thanks for your tips.
> >
> > Yes, the url="/" works for the invoke tag.
> >
> > And yes, it's the log4j.properties file that was distributed with WebTest
> (Plugin) in folder "${webtest.home}/classes", "$WEBTEST_HOME/lib"
> respectively in the standalone application.
> >
> > 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?
> >
> > Greetings!
> >
> >
> > ----- Original Nachricht ----
> > Von: Paul King <[EMAIL PROTECTED]>
> > An: [email protected]
> > Datum: 05.09.2006 00:44
> > Betreff: Re: [Webtest] How To Debug Tests
> >
> >> Some suggestions:
> >>
> >> Does url="/" work in the invoke?
> >>
> >> Is the log4j.properties you were modifying in
> path="${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 from
> the
> >> Canoo website:
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>> <!DOCTYPE project [
> >>> <!ENTITY taskdef SYSTEM
> >> "taskdef.xml">
> >>> ]>
> >>> <project name="SimpleTest" basedir="." default="main">
> >>>
> >>> &taskdef;
> >>>
> >>> <target name="main">
> >>> <webtest name="myTest">
> >>> <config host="127.0.0.1" port="9090" protocol="http"
> >> basepath="/myapp" />
> >>> <steps>
> >>> <invoke description="get Login Page" url="login"
> >> method="GET"/>
> >>> <verifyTitle description="we should see the login title"
> >> text="Login Page" />
> >>> </steps>
> >>> </webtest>
> >>> </target>
> >>> </project>
> >>>
> >>>
> >>> The included "taskdef" entity looks like this:
> >>>
> >>> <taskdef file="${webtest.home}/webtestTaskdefs.properties">
> >>> <classpath>
> >>> <fileset dir="${webtest.home}">
> >>> <include name="lib/*.jar"/>
> >>> <include name="lib/base/*.jar"/>
> >>> </fileset>
> >>> <pathelement path="${webtest.home}/lib"/>
> >>> </classpath>
> >>> </taskdef>
> >>>
> >>>
> >>> Now when I try to run the test by executing "maven webtest:test" I get
> 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 is
> >> available by requesting it successfully in a browser. Thus I assume the
> 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 + telefonieren
> >>> ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor:
> >> günstig
> >>> und schnell mit DSL - das All-Inclusive-Paket für clevere
> Doppel-Sparer,
> >>> nur 44,85 ? inkl. DSL- und ISDN-Grundgebühr!
> >>> http://www.arcor.de/rd/emf-dsl-2
> >>> _______________________________________________
> >>> WebTest mailing list
> >>> [email protected]
> >>> http://lists.canoo.com/mailman/listinfo/webtest
> >>>
> >>>
> >> _______________________________________________
> >> WebTest mailing list
> >> [email protected]
> >> http://lists.canoo.com/mailman/listinfo/webtest
> >>
> >
> > Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
> > ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor:
> günstig
> > und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
> > nur 44,85 ? inkl. DSL- und ISDN-Grundgebühr!
> > http://www.arcor.de/rd/emf-dsl-2
> > _______________________________________________
> > WebTest mailing list
> > [email protected]
> > http://lists.canoo.com/mailman/listinfo/webtest
> >
>
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>
Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur 44,85 inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest