[Webtest] ReportSite step

Jon Poulton [kinomi] webtest@lists.canoo.com
Tue, 10 Jan 2006 10:53:46 -0000


Hi Denis,
Good to hear from you, as it's your code I've been butchering for the last
day or two. ;-p
Right, what I was doing to build and test webtest was the following:

[In Canoo development home]
> ant clean
> ant

This was giving me the problem described below. However, I've done as you
suggested and did the following:

[In Canoo development home]
> ant clean
> webtest clean develop

This seemed to get a little further in the build/test cycle, although I
still got an error message associated with one of the pdf steps. The failure
message inside selftTestReport.xml was as follows:

<failure message="com.canoo.webtest.engine.StepFailedException: <unknown>:
**** The current response and the expected result file
'expected\expectedPdfBookmarks.txt' differ. , Step: CompareToExpected at
C:\Java\eclipse\workspace\canoo\webtest\selftests\tests\pdfBookmarks.xml:33:
with (toFile="expected\expectedPdfBookmarks.txt", description="<unknown>",
saveFiltered="true", readFiltered="false",
stepType="compareToExpected")com.canoo.webtest.extension.CompareToExpected(d
escription="<unknown>", wrappedSteps=[<PdfToBookmarksFilter at
C:\Java\eclipse\workspace\canoo\webtest\selftests\tests\pdfBookmarks.xml:34:
with (description="extract PDF bookmarks",
stepType="pdf:toBookmarksFilter")> <LineSeparatorFilter at
C:\Java\eclipse\workspace\canoo\webtest\selftests\tests\pdfBookmarks.xml:35:
with (description="normalise line separators",
stepType="lineSeparatorFilter")> ])" />

This isn't much help as the files it asks me to compare (and their parent
directories) do not exist. I do not know if they were temporary files that
were erased, or if the output generated for the test report is incorrect or
out of date. Any ideas?

cheers

Jon

-----Original Message-----
From: webtest-admin@gate2.canoo.com [mailto:webtest-admin@gate2.canoo.com]
On Behalf Of Denis N. Antonioli
Sent: 10 January 2006 10:25
To: webtest@gate2.canoo.com
Subject: Re: [Webtest] ReportSite step

Hi

how are you starting the tests?

In my experience, going to the webtest directory and typing:
bin/webtest clean develop
was all that was necessary to build and test a new release.

Best
	dna

On 9 janv. 06, at 17:50, Jon Poulton [kinomi] wrote:

> Oh, and one more question. I have sorted out CVS access to the  
> webtest source code, but when I do a build the web application  
> tests fail. How do I start up Jetty so they pass? I noticed that  
> the Jetty jar files are under source control. The error I get is:
>
>
>
> java.lang.reflect.InvocationTargetException
>
>         at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown  
> Source)
>
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:324)
>
>         at  
> org.apache.tools.ant.taskdefs.ProcessDestroyer.removeShutdownHook 
> (ProcessDestroyer.java:116)
>
>         at org.apache.tools.ant.taskdefs.ProcessDestroyer.remove 
> (ProcessDestroyer.java:186)
>
>         at org.apache.tools.ant.taskdefs.Execute.execute 
> (Execute.java:495)
>
>         at org.apache.tools.ant.taskdefs.Java.fork(Java.java:702)
>
>         at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java: 
> 161)
>
>         at org.apache.tools.ant.taskdefs.Java.execute(Java.java:77)
>
>         at org.apache.tools.ant.UnknownElement.execute 
> (UnknownElement.java:269)
>
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>
>         at org.apache.tools.ant.Target.execute(Target.java:301)
>
>         at org.apache.tools.ant.Target.performTasks(Target.java:328)
>
>         at org.apache.tools.ant.Project.executeTarget(Project.java: 
> 1215)
>
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
>
>         at org.apache.tools.ant.UnknownElement.execute 
> (UnknownElement.java:269)
>
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>
>         at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run 
> (Parallel.java:420)
>
>         at java.lang.Thread.run(Thread.java:534)
>
> Caused by: java.lang.IllegalStateException: Shutdown in progress
>
>         at java.lang.Shutdown.remove(Shutdown.java:102)
>
>         at java.lang.Runtime.removeShutdownHook(Runtime.java:218)
>
>         ... 19 more
>
>      [java] Java Result: 1
>
>
>
> Jon
>
>
>
> From: webtest-admin@gate2.canoo.com [mailto:webtest- 
> admin@gate2.canoo.com] On Behalf Of Jon Poulton [kinomi]
> Sent: 09 January 2006 16:39
> To: webtest@gate2.canoo.com
> Subject: [Webtest] ReportSite step
>
>
>
> Hello everyone,
>
> I was recently looking through the list of core and extension steps  
> to see if I could find a step container that would do the  
> following: for each page on a website perform 'n' verification  
> steps. This would involve moving in a spider-like fashion through  
> all of a web applications pages, and calling the same set of steps  
> after reaching each page. In some ways this would work a little  
> like the <verifyLinks> step, as it would also verify that all the  
> links in the webapp worked.
>
>
>
> I found a largely undocumented class which seemed to do something  
> along these lines called <reportSite>, which is an extension step  
> written by someone called Denis Antonioli. After having a look at  
> the source it seemed to do more or less what was required, although  
> unfortunately the Spider class it used wasn't quite working  
> correctly (it tries to click mailto: links, and occasionally does  
> other strange things). Anyway, I've written a replacement class in  
> my own package. It's not entirely finished, but it does the job as  
> far as our requirements go. I was wondering a few things:
>
>
>
> 1)       What are the spider package extension steps supposed to  
> do, exactly? Are they still under development (hence lack of  
> documentation)? Is anyone using them?
>
> 2)       Is anyone interested in the replacement classes I've written?
>
> 3)       If so, what would be the best way forward? Replace the  
> existing spider classes? Deprecate the existing classes and place  
> mine in a separate package?
>
>
>
> To give an idea of how the stuff I've written works, the test XML  
> would be something like:
>
>
>
>         <steps>
>
>           <!-- Log on. -->
>
>               &logon;
>
>
>
>               <reportSite excludes="([\w:/]*/webapp/logoff))"  
> description="A set of steps to perform on every page of the site,  
> avoiding logoff pages.">
>
>                 <verifyText description="Verify the text 'Kinomi'  
> is present on the page." text="Kinomi" regex="false" />
>
>                 <not description="Verify that there are no missing  
> links to resource strings." >
>
>                   <verifyText description="Check for presence of ??? 
> resource.key???" text="\?\?\?\w*\?\?\?" regex="true" />
>
>                 </not>
>
>             <!-Extra steps applicable to groups of pages go here-->
>
>           </reportSite>
>
>
>
>         </steps>
>
>
>
> Let me know what you think,
>
> Cheers,
>
>
>
> Jon Poulton
>
>
>
>

-- 
A computer scientist is someone who, when told to "Go to Hell,"
sees the "go to," rather than the destination, as harmful.
   -- Dr. Roger M. Firestone, rfire@cais.cais.com

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest