Announcement Announcement Module
Collapse
No announcement yet.
suggestions for web test tool? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • suggestions for web test tool?

    I've been using JWebUnit for awhile, and while I appreciate the ingenuity that went into writing it, I find that creating tests with JWebUnit is a daunting, time consuming task.
    Does anyone in the forum have any experience using another web test tool, free or otherwise?
    What I'm looking for is a tool that can ...
    1) Allow one to create test cases by pointing, clicking, and typing into a browser.
    2) Allow slow playback of test cases so that a non-developer can understand what's being tested. Of course the tool should also allow fast playback.
    3) Allow for simple testing of expectactions. With JWebUnit I find that I very rarely go any further than checking that the expected title and one or two expected Strings is present, and that's fine. In my project the web tests are mostly tests of navigation-- core testing is left for either JUnit or DBUnit extensions.
    4) Allow hooks where java code can be executed. For example, at the beginning of a test case, I almost invariably like to call off to a DBUnit utility to setup the database appropriately.
    5) Ignore minor javascript errors that don't actually affect the user's experience.

  • #2
    web tool?

    I realize my question has nothing to do with Spring, but this is my favorite forum, and I greatly respect the opinions of the people who post here.

    Comment


    • #3
      I have used canoo and I was pleased with the results. It contains also a nice tool for recording your clicks which worked in my case.
      The problem is that it can't handle javascripts and it can be hard to work on non xhtml pages as it uses XPATH for analyzing the pages and it can return bogus results if the html is not compliant.

      Comment


      • #4
        htmlunit

        I've tried jwebunit in the past, but i didn't find it as good as htmlunit for testing. the only problem is that htmlunit is more like httpunit rather than jwebunit. i had to create a layer on top of htmlunit to make it a bit easier and quicker to create new tests.

        unfortunately, this doesn't answer you're direct question, but i reckon that it would be possible abstract the configuration into xml like

        [tests base="http://www.mysite.com"]
        [test]
        [start uri="mypage.html"/]
        [click-link-with-text value="click me"/]
        [/test]
        [/tests]

        for example, in fact, it prolly wouldn't take too long to replicate the canoo format using the superior htmlunit framework underneath. i'd be interested in doing some work on it if ur interested?

        btw, frameworks that proxy requests and build test cases from them are rarely of use, it is too easy to create tests without sufficient knowledge of the application which leads to very fragile tests...

        Comment


        • #5
          :$

          sorry, there should be an extra line like;

          [assert title="this is the title of mypage.html" /]

          :P

          Comment


          • #6
            For now I'd prefer many fragile tests rather than very very few solid web tests I have, so I'm still interested in frameworks that either proxy requests or that manipulate the browser directly. (The advantage of the latter is that you even test whether your view pages are routing to the correct url.)

            So far I've looked at QEngine 5 WebTest Download (manipulates the browser) and JMeter (proxies request and therefroe does not use the browser). Both look promising. With Web Test I haven't figured out yet how to how to put in hooks to setup the database for a given test. With JMeter all things seem possible, but the tool is fairly complex to learn.

            Comment


            • #7
              We use JMeter for our web testing. It allows recording and has a nice UI for creating test cases.

              Comment


              • #8
                paxil - http://www.bestrxpills.com

                Comment


                • #9
                  How do others check HTML validation locally? IDE or HttpUnit/JTidy or other? What about validating against the actual DTD (e.g. http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd).

                  Comment


                  • #10
                    May I suggest Selenium? It handles Javascript and the test cases are written in simple HTML tables.

                    http://selenium.thoughtworks.com/index.html

                    Comment


                    • #11
                      Try Bad Boy. http://www.badboy.com.au/

                      Comment


                      • #12
                        We ended up building our own, using JTidy to convert pages to XML, which I think HttpUnit or one of those might do. We didn't really want to build something, but everything seems to suck basically. The "record then play" approach, e.g. JMeter, just seems to be more trouble than it's worth.

                        Input into the web test is an XML doc, that's processed by a SAX reader.

                        You can use a 'param' element for hardcoded params, or 'paramPath' and specify an xpath expression that extracts data from the previous response. You can also use a 'dynParam' (dynamic param) element to call a remote method to get some test data. We've exposed some business objects that exist purely for testing using the Spring HttpInvoker, and can call a parameterless method to get data to be used in a GET or POST. This beats trying to maintain a 'testDB' with special values in it that your test script knows about.

                        Similarly, you can specify a 'url' element (hardcoded destination), or 'urlPath' that has an xpath expression, which allows you to pull a dynamic url from the previous response, e.g. get a url from a search result grid.

                        We've also got 'show' elements for println'ing stuff, and a 'compare' element for doing assertions.

                        It handles preservation of the session by requiring that jsessionid be embedded as a hidden field, which is a bit sucky, but not hard to do if you've got something like stdIncludes.jsp.

                        Lastly, it's got limited flow of control support with a <while> element to do loops.

                        We couldn't find anything else that did this. We're using Clover to test code coverage and couldn't really drive the coverage % up without these features.

                        Comment


                        • #13
                          Originally posted by katentim
                          How do others check HTML validation locally? IDE or HttpUnit/JTidy or other? What about validating against the actual DTD (e.g. http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd).
                          Ended up just writing a Perl script to remove tags (c, fmt, etc...) and convert Struts tags to HTML (another example of why I prefer Spring's approach of avoiding HTML generation in tags). You can then use Ant's validate task to validate directly against the DTD. Now I can validate 500 pages in 10 seconds.

                          Comment

                          Working...
                          X