Sorry for not responding earlier. I was overseas for most of
the week and didn't have very good (cheap) Internet access.
For (3) it looks like you are setting up a database using dbunit
and it can't find the table you are trying to update. The email
steps themselves don't use dbunit, so I think the problem is
with the dbunit config. I can't tell whether the email steps
are being run correctly and the problem is with subsequent steps
or ant tasks or if it stops before reaching the email steps.
For (4) you could look at something like <retry>. The email manual
selftests use this approach. Here is a snippet:
<target name="awaitArrival">
<sleep seconds="15"/><!-- initial delay to wait for messages to arrive
-->
<webtest name="emailManualTests: awaitArrival">
<steps>
&sharedConfiguration;
<emailSetConfig server="${mailserver}" type="pop3" password="${password}"
username="${username}"/>
<retry maxcount="15">
<sleep seconds="5"/>
<emailStoreMessageCount subject="/mailtest - multifiles/"
property="emailcount"/>
<verifyXPath xpath="#{emailcount}>=3" text="true"/>
</retry>
</steps>
</webtest>
</target>
This example waits 15 seconds initially then loops up to 15 times
with a 5 second delay during each loop. This will allow you to use
more reasonable delay settings which don't slow your tests down too
much waiting for the worst case email delay - which could be quite
large.
Note: you might have to experiment with the loop delay. Some email
servers don't like being called repeatedly in quick succession.
They introduce a delay to stop denial of service attacks and/or
minimise the possibility of multiple simultaneous logins.
Cheers, Paul.
Marc Guillemot wrote:
3 & 4) sorry, I've never used these steps, perhaps can Paul answer your
question.
Marc.
PS: what about using the latest build, it would be easier for us to look
at a particular line of the source
Stefan Kuhn wrote:
Concerning webtest.version::Canoo Webtest: R_1217.
I have several problems with Canoo Webtest, they could be split in
these points:
3. Access an email (via the filters)
4. Proper way to wait for a specific email
3)
I switched to testing emails and after some hours I stuck in problems
again.
I want to access the content of a plain email. Therefore I want to
SAVE the email once. Whenever I try to do this, an exception is thrown
Following code is working:
<emailSetConfig server="@{eMail.mailServer}"
type="@{eMail.serverType}" password="@{eMail.password}"
username="@{eMail.userName}" delay="@{eMail.serverDelay}" />
<sleep seconds="@{emailReceiveTime}"/>
<emailStoreMessageId
from="@{eMail.petToyServerEMailAdress}" to="@{eMail.UserEmailAddress}"
property="confirmEMail.id" propertyType="dynamic"
subject="@{eMail.registerdNewUserSuccessfully.Header}" />
<emailMessageContentFilter description="MessageContent of
confirmation email" contentType="simple"
messageId="#{confirmEMail.id}" />
I verified that the code is working properly by adding <verifyText
text="xxxx"/> with good/bad values.
If I add to emailMessageContentFilter save="xxx" or if I change in my
<config> saveresponse="true" the following exception occurs:
C:\\webtest\commonTasks.webLib.xml:258: The following error occurred
while executing this line:
C:\\website\build.xml:310: org.dbunit.dataset.NoSuchTableException:
rotina
ERROR (com.canoo.webtest.steps.Step) - Cannot handle unexpected
exception in step AntWrapper at with (description="<unknown>")
C:\\website\webtest\testes\createNewUser.webtest.xml:108: The
following error occurred while executing this line:
C:\\website\webtest\commonTasks.webLib.xml:258: The following error
occurred while executing this line:
C:\\website\build.xml:310: org.dbunit.dataset.NoSuchTableException:
rotina
at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
at
org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:380)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:64)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
4)
Is there a better way than try to guess the time until a specific
email arrives? My code right now looks like this and is not very useful.
<emailSetConfig .../>
<sleep seconds="@{emailReceiveTime}"/>
<emailStoreMessageCount ...
Thanks /MfG
Stefan
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest