History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: WT-354
Type: Bug Bug
Status: Open Open
Assignee: Marc Guillemot
Reporter: Matt Raible
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
WebTest

Release 1641 not compatible with Scriptaculous 1.8.0 (Prototype 1.6.0)

Created: 24/Nov/07 17:06:33   Updated: 05/May/08 10:55:36
Affects Version/s: 2.5
Fix Version/s: None


 Description   
Embedded error: The following error occurred while executing this line:
/Users/mraible/dev/appfuse-2.0/web/jsf/src/test/resources/login.xml:1: JavaScript error loading page http://localhost:9876/appfuse-jsf-2.0.1-SNAPSHOT/login.jsp: [object Error] (http://localhost:9876/appfuse-jsf-2.0.1-SNAPSHOT/scripts/prototype.js#596)

Line 596 is "if (e != $break) throw e;" in the following block:

var Enumerable = {
  each: function(iterator, context) {
    var index = 0;
    iterator = iterator.bind(context);
    try {
      this._each(function(value) {
        iterator(value, index++);
      });
    } catch (e) {
      if (e != $break) throw e;
    }
    return this;
  },

 All   Comments   Change History      Sort Order:
Comment by Marc Guillemot [26/Nov/07 20:49:30]
As usual:
- WebTest 2.5 is quite old now. Have you tried with a recent build? With a recent build with a recent snapshot of HtmlUnit-1.14?
- do you have a publicly available website showing the problem?

Comment by Marc Guillemot [26/Nov/07 20:51:32]
I now see "Release 1641" in issue's title and 2,5 in affected version. Which one do you really use?

Comment by Matt Raible [26/Nov/07 21:00:19]
I'm using Release 1641. If there's a more recent build, or HtmlUnit 1.1.4 is available in a public Maven Repo - I can try upgrading.

Comment by Marc Guillemot [27/Nov/07 09:52:12]
You can pick latest HtmlUnit-1.14 snapshot from http://build.canoo.com/htmlunit/artifacts/ and place it in your webtest lib dir in place of HtmlUnit-1.13.jar.

Comment by Matt Raible [02/Jan/08 19:35:42]
Do you know when HtmlUnit 1.14 will be released? Has it been tested with the latest version of Prototype?

Comment by Marc Guillemot [08/Jan/08 17:00:07]
HtmlUnit 1.14 will normally released this week. It integrates Prototype unit tests but not all are passing. Most of the one that fail should be irrelevant but...

Comment by Matt Raible [04/May/08 07:05:25]
Any update on this issue? Is there a release of WebTest that uses HtmlUnit 2.x yet?

Comment by Marc Guillemot [05/May/08 09:53:29]
WebTest uses HtmlUnit-2.1 since build 1700. Please tell me if the problem still exists (a publicly available url would be great)

Comment by Matt Raible [05/May/08 10:01:11]
I've successfully upgraded to R_1702 and Prototype 1.8.1. Works with everything but JSF. For some reason, the fileupload test passes with R_1600 and not R_1702.

http://issues.appfuse.org/browse/APF-946#action_12448

Matt

Comment by Matt Raible [05/May/08 10:04:39]
More on the JSF (MyFaces 1.2.2) issue...

Canoo WebTest causes the filename to be /Users/mraible/Work/appfuse-2.0/web/jsf/pom.xml, which is the same path that's in the input box when I do it through my browser. However, when I do it through the browser, file.getName() returns "pom.xml" instead of the full path. I can truncate the beginning of the path, but this seems like a regression bug in CWT.

Comment by Marc Guillemot [05/May/08 10:14:25]
With which browser do you test? If I correctly remember, HtmlUnit mimics browser's behaviour here and IE or FF sends the absolute file name, whereas the other sends only the file name without path.

Comment by Matt Raible [05/May/08 10:18:11]
I haven't configured any for CWT:

<config host="${host}" port="${port}" protocol="http"
    basepath="${webapp.name}" resultpath="target/webtest-data" saveresponse="true"
    resultfile="web-tests-result.xml" summary="true">
    <header name="Accept-Language" value="${user.language}"/>
</config>

When I manually tested it, I used Firefox 3 on OS X.

My class does have this:

        // APF-758: Fix for Internet Explorer's shortcomings
        if (filename.indexOf("\\") != -1) {
            int slash = filename.lastIndexOf("\\");
            if (slash != -1) {
                filename = filename.substring(slash + 1);
            }
            // Windows doesn't like /'s either
            int slash2 = filename.lastIndexOf("/");
            if (slash2 != -1) {
                filename = filename.substring(slash2 + 1);
            }
            // In case the name is C:foo.txt
            int slash3 = filename.lastIndexOf(":");
            if (slash3 != -1) {
                filename = filename.substring(slash3 + 1);
            }
        }

Adding the following before it is a workaround that works:

        // APF-946: Canoo Web Tests R_1702 sets full path as name instead of only file name
        if (filename.indexOf("/") > -1) {
            filename = filename.substring(filename.lastIndexOf("/") + 1);
        }

Comment by Marc Guillemot [05/May/08 10:38:24]
Have you tried with IE for Mac? My guess is that you would have the same thing than with WebTest.

I think that HtmlUnit correctly mimics IE's behaviour when running on windows (and has "\\" in filename), but when running on *nix, it has "\" as path separator. It would probably make sense for WebTest to allow to specify with which path a file should be uploaded. Please open a new issue for that if it makes sense for you.-

Comment by Matt Raible [05/May/08 10:50:33]
My only concern is that R_1600 would spit out the relative filename (pom.xml) whereas R_1702 spits out the absolute filename (/Users/mraible/Work/appfuse-2.0/web/jsf/pom.xml). I didn't change any code - the behavior is different between versions. I'm not too concerned about it since I figured out a workaround, but it seems like the former mimicked true browser behavior (of Firefox on OS X) more than the later.

Comment by Marc Guillemot [05/May/08 10:55:36]
If you don't configure any User-Agent header, your WebTest test will mimic Internet Explorer. If you configure a Firefox header, your WebTest will mimic Firefox and will for instance only send "pom.xml".