Webtest with Canoo
One thing that kept breaking in my attempt to conquer the GRAILS basics was webtesting. I set up a fairly standard webtest that ran through a pre-recorded set of web-actions. No matter what coding I put into the file it would always throw a null point exception: “Cannot invoke method toInteger() on null object”
Console output
…
Loading with installed plug-ins: ["webtest", "autobase"] …
[copy] Copying 1 file to C:\Users\ElmarS\.grails\1.0.4\projects\CollabToDo
Running WebTest …
Cannot invoke method toInteger() on null object
…
Solution:
Problem was, that I created the domain testfile manually (i.e. PersonTest.groovy). Webtest files need to be generated with the create-webtest command though – at least for the first run as it seems . This is because it creates an additional TestSuite.groovy in the same test directory. I would have expected this file creation to be part of the plugin-installation process. But well, it´s not a perfect world, right
Did you know -> canoo has a free Plugin for Firefox that let´s you record webtests instead coding the sequences yourself! Check it out – it can save you hours of work
No comments yet
Leave a reply