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

Key: WT-497
Type: Bug Bug
Status: Open Open
Assignee: Unassigned
Reporter: Tai Siew Joon
Votes: 1
Watchers: 3
Operations

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

Release 1708 not compatible with jQuery 1.3.1

Created: 02/Feb/09 04:43:48   Updated: 10/Dec/09 19:23:20
Affects Version/s: 2.6
Fix Version/s: None

File Attachments: 1. File jq131.tar.bz2 (213 kb)

Environment: Ubuntu 8.10, grails 1.1-beta3, groovy 1.6-RC-2, grails WebTest plugin 0.5.1, jdk1.6.0_11, jQuery 1.3.1


 Description   
I have a test application written in grails. The WebTest plugin failed with the following error message when jQuery 1.3.1 is included:

JavaScript error loading page http://localhost:8080/jq131/foo/create: TypeError: Cannot find function createComment in object [object]. (http://localhost:8080/jq131/js/jquery.js#2076)

I also tested with v0.6 of the plugin (R_1724) and the same error message was encountered.

Replacing jquery.js with version 1.2.6, WebTest will pass the test.

The test application works perfectly in Firefox 3 and IE 7. No JavaScript error is encountered.

Test case in webtest/tests/FooTest.groovy, test result is webtest/reports/index.html


 All   Comments   Change History      Sort Order:
Comment by Zden?k B?lehrádek [06/Feb/09 16:52:04]
This bug has been resolved in latest HTMLUnit snapshot.

Comment by Krystian Nowak [15/Apr/09 14:08:13]
Here is a description what could be done in Canoo Webtest to be compatible with the new jQuery - based on the latest HTMLUnit snapshot - as described by Zdenek in http://webtest-community.canoo.com/jira/browse/WT-497#action_12880

Assuming usage of the latest Canoo Webtest snapshot from http://webtest.canoo.com/webtest/build.zip (currently R_1762)
1. Download: http://build.canoo.com/htmlunit/artifacts/htmlunit-2.5-SNAPSHOT-with-dependencies.zip
2. Copy to the lib directory the following files:
- htmlunit-2.5-SNAPSHOT.jar
- htmlunit-core-js-2.5-SNAPSHOT.jar
- nekohtml-1.9.12-20090308.130127-11.jar
3. Remove older versions of the libraries given above correspondingly.

Comment by Krystian Nowak [21/Apr/09 14:56:16]
It seems like the URLs given by myself above (in previous comment) are no longer valid, since SNAPSHOT versions are not used any more because new HtmlUnit (stable 2.5) has been released today:
- http://htmlunit.sourceforge.net/
- http://sourceforge.net/project/showfiles.php?group_id=47038&package_id=39976&release_id=677331

Canoo in their builds also started using stable 2.5 versions too:
http://build.canoo.com/htmlunit/artifacts/ -> http://build.canoo.com/htmlunit/artifacts//htmlunit-2.5-with-dependencies.zip

Since currently on http://webtest.canoo.com/webtest/manual/Downloads.html the latest version of Canoo Webtest is R_1762 and this is the version which needs the patch described in previous comment, we can assume that the next Canoo Webtest release (R > 1762) will have 2.5 stable version of HtmlUnit and no more patching is needed!


Comment by Krystian Nowak [28/Apr/09 17:00:10]
It seems to be fixed in latest snapshot (Latest build: R_1765 / Posted: 27-Apr-2009 17:06) - http://webtest.canoo.com/webtest/manual/changeLog.html - just download it from http://webtest.canoo.com/webtest/build.zip



Comment by Krystian Nowak [28/Apr/09 17:01:45]
BTW. It seems to be connected to WT-518 (which is now resolved)

Comment by Andrew Carlson [10/Dec/09 19:23:20]
I am seeing this issue in R_1799 with HtmlUnit-2.7-SNAPSHOT.jar in webtest R_1799. Running on the following platform:

Imac G4 PPC OSX 10.5.8, Java 1.5.0_16, jquery.js version 1.3.2.

Performed an SVN CO to check out the latest version of webtest, set environment. I have a simple script to just open a site and verify the title - if the site does not use jquery the test passes. If the site uses or loads jquery, the test fails with the error message:

Error:
JavaScript error loading page http://sitename.internal.devserver/: TypeError: Cannot find function createComment in object [object].

I have tried both the 3.0 release and the R_1799 and receive the same error message, command to run tests is webtest.sh -buildfile test.xml - I have tried this same test using both the property form of url and by just specifying the url in the invoke command directly with no difference in results.

I was going to attempt to disable javascript using the webtest enable javascript command to see if that made a difference.

test script:
<project name="myTest" basedir="." default="wt.full">

  <property name="webtest.home" location="/Users/spike/imm/webtest/" />
  <property name="url" value="http://sitename.internal.devserver/" />
  <import file="${webtest.home}/webtest.xml"/>

  <target name="wt.testInWork">
    <webtest name="myTest">
      <steps>
        <invoke
          description="Open Landing Page"
          url="${url}" />
      </steps>
    </webtest>
  </target>
</project>

(*script and commands have been filtered due to NDA requirements)