8 messages in com.canoo.lists.webtestRE: [Webtest] Webtest and javascript ...| From | Sent On | Attachments |
|---|---|---|
| Loehr, Ruel | 19 Mar 2008 07:58 | |
| Marc Guillemot | 19 Mar 2008 08:14 | |
| Loehr, Ruel | 19 Mar 2008 11:15 | |
| Marc Guillemot | 20 Mar 2008 00:48 | |
| ruel loehr | 20 Mar 2008 07:46 | |
| Soula, William | 20 Mar 2008 08:08 | |
| Marc Guillemot | 25 Mar 2008 01:42 | |
| Soula, William | 25 Mar 2008 05:17 |
| Subject: | RE: [Webtest] Webtest and javascript templates![]() |
|---|---|
| From: | Soula, William (wso...@pointserve.com) |
| Date: | 03/20/2008 08:08:23 AM |
| List: | com.canoo.lists.webtest |
I work with Ruel and have the same problem he did so I did what he did and
upgraded to 2.6 and then dropped in the latest HTMLUnit snapshot jar(from today
build.862) and xalan-2.7.0.jar. When I run the below test it fails on the not
step but when I revert to the htmlunit released with WebTest 2.6 the test
succeeds. This appears to be a bug. Am I correct or is it because I have
hacked together my webtest?
<config host="www.google.com"/>
<invoke url=""/>
<not>
<verifyXPath
xpath="//img[@src='/images/alert.gif']" description="Check that no error was
displayed"/>
</not>
William Soula QA Analyst
Pointserve, Inc. 110 Wild Basin Road Suite 300 Austin, Texas 78746 O: 512.617.5311 F: 512.617.0466
-----Original Message-----
From: webt...@lists.canoo.com [mailto:webt...@lists.canoo.com] On
Behalf Of ruel loehr
Sent: Thursday, March 20, 2008 9:47 AM
To: webt...@lists.canoo.com
Subject: Re: [Webtest] Webtest and javascript templates
Well, I only tested my one failing test (not my whole suite) and I had to add
xalan-2.7.0.jar to the classpath.
I'll have to validate the rest of the suite, but I was more concerned with
finding the reason for my initial problem.
Our other main reason?
1) Awesome documentation 2) Beautiful reports that are easy to understand 3) The webtests are really easy to write. 4) I can integrate them into my automated build system.
Simple software concept -- make it beautiful and easy to understand and people
will use it.
I have also messed around with upgrading to 2.6. I see you now publish a junit-xml. Hotness. That makes it work out of the box with cruise control and hudson.
Marc Guillemot wrote:
it is possible to drop a HtmlUnit-2.0 snapshot in place of HtmlUnit-1.14 in WebTest-2.6? Surprising, I thought it wasn't compatible.
What are the other main reasons for your webtest usage? ;-)
Cheers, Marc. -- Blog: http://mguillem.wordpress.com
Loehr, Ruel wrote:
Yeah. I upgraded to webtest 2.6 and dropped in the htmlunit 2.0 snapshot and the test passed.
Good stuff. Thanks for being so responsive. It's one of the main reasons we use webtest as opposed to other frameworks. ;)
R
-----Original Message----- From: webt...@lists.canoo.com [mailto:webt...@lists.canoo.com] On Behalf Of Marc Guillemot Sent: Wednesday, March 19, 2008 10:15 AM To: webt...@lists.canoo.com Subject: Re: [Webtest] Webtest and javascript templates
seems to be mainly String processing therefore this shouldn't cause special problem... except with RegEx
The issue you have here is due to HtmlUnit RegExp processing (which replaces the native one of Rhino due to different problems) which doesn't escape curly braces correctly. This should be fixed in latest snapshot of HtmlUnit 2.0. Perhaps can you give it a try (directly, not within WebTest currently)?
Cheers, Marc. -- Blog: http://mguillem.wordpress.com
Loehr, Ruel wrote:
Hey gang.
Some developers just added javascript templates to our webapp and hose the webtests.
http://code.google.com/p/trimpath/wiki/JavaScriptTemplates is the project that they are using.
First question is:
1) Does webtest support this? I think the answer is no but am looking for official answer.
What I see on the client side is we make an http request to get a jst template. I receive a response no prob. Here is an example.
[sleep] DEBUG (httpclient.wire.content) - << "{var hourValues = ["01","02","03","04","05","06","07","08","09","10","11"]}[\r][\n]"
[sleep] DEBUG (httpclient.wire.content) - << "{var minuteValues = ["00","30"]}[\r][\n]"
[sleep] DEBUG (httpclient.wire.content) - << "{var ampmValues = ["AM","PM"]}[\r][\n]"
In theory, we would get the jst template and them some javascript would execute which would plug in the values. However, in webtest, I end up with:
[sleep] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest) - Calling onreadystatechange handler for state 3
[sleep] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest) - onreadystatechange handler:
[sleep] function () {
[sleep] return __method.apply(object, args.concat($A(arguments)));
[sleep] }
[sleep]
[sleep] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest) - Calling onreadystatechange handler for state 3. Done.
[sleep] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest) - Calling onreadystatechange handler for state 4
[sleep] DEBUG (com.gargoylesoftware.htmlunit.WebResponseImpl) - No charset specified in header, trying to guess it from content
[sleep] DEBUG (com.gargoylesoftware.htmlunit.WebResponseImpl) - No charset guessed, using ISO-8859-1
[sleep] DEBUG (com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest) - XMLHttpRequest.responseXML was called but the response is
[sleep] Exception in thread "HtmlUnit Managed Thread #7: XMLHttpRequest.send" java.lang.StackOverflowError
[sleep] at java.util.regex.Pattern$Curly.match(Pattern.java:4190)
[sleep] at java.util.regex.Pattern$GroupHead.match(Pattern.java:4570)
[sleep] at java.util.regex.Pattern$Loop.match(Pattern.java:4697)
[sleep] at java.util.regex.Pattern$GroupTail.match(Pattern.java:4629)
[sleep] at java.util.regex.Pattern$Curly.match0(Pattern.java:4235)
[sleep] at java.util.regex.Pattern$Curly.match(Pattern.java:4197)
[sleep] at java.util.regex.Pattern$Curly.match0(Pattern.java:4235)
[sleep] at java.util.regex.Pattern$Curly.match(Pattern.java:4197)
This is a sample jst template:
<h2>Appointment Scheduling</h2>
<table style="padding-right: 3px;padding-left: 0px;padding-bottom: 5px;padding-top: 5px;">
<tr>
<th style="font-weight: normal;vertical-align: top;color: #484848;white-space: nowrap;background-color: #ffffff;text-align: left;padding-top: 1px;padding-right: 12px;padding-left: 20px;">Minimum Lead Time:</th>
<td style="padding-left: 0px;padding-right: 2em;vertical-align: top;border-top-style: none;border-right-style: none;border-left-style: none;border-bottom-style: none;">
<select name='defaultApptLeadTime'>
{for leadTime in schedulingConfig.leadTimes}
{if schedulingConfig.defaultApptLeadTime == leadTime}
<option value="${leadTime}" selected="selected">${leadTime}</option>
{else}
<option value="${leadTime}">${leadTime}</option>
{/if}
{/for}
</select>
working days
</td>
</tr>
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest
--
View this message in context:
http://www.nabble.com/Webtest-and-javascript-templates-tp16158255p16180299.html
Sent from the WebTest mailing list archive at Nabble.com.
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest




