Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

HowTo: Get an input field's value with Canoo's WebTest

I should start this by saying that I love Canoo's WebTest. It allows you to test clicking through your webapp as if you're using a browser. You simply write your tests in an XML file (which is really an Ant build file), and then run it with Ant. Usually, in my webapps, I write simple tests for CRUD on entities - i.e. EditUser (tests pulling up the edit screen), SavePosition (edit and save, verifies next screen's title), SearchUsers (verifies list screen's title).

One of the issues I had this morning was testing a wizard with WebTest. This was because I didn't know how to get the id of the new record after it was added. Now I found a way. Let's say you have a Create a Job wizard. On the first screen, you enter the job, and on the second, you add the required skills, on the third, you view a summary. To get the new id of the job, you can use XPath to get the hidden field named "jobId" - to do with what you may (i.e. click on a link to the third screen). Here's how: {{{ }}} This is especially helpful because I tend to use a lot of onclick handler's (with location.href's) on buttons (so I don't have to submit to the same action). I also turn off JavaScript for my tests - by not including js.jar in WebTest's classpath. I can't say enough about this tool - the ability to test your app, with JavaScript turned off, and verify that everything works... that's just cool. Especially when you're a JavaScript junkie like me.

Posted in Java at Jan 06 2004, 05:25:15 PM MST 5 Comments
Comments:

Have you tried maxq http://maxq.tigris.org ? How does it compare to Webtest? I love that maxq support HTTP test recording, scripting, and playback, which makes testing so much easier.

Posted by Unknown on January 06, 2004 at 08:38 PM MST #

MaxQ looks nice, but it doesn't look like it would be possible to automate it. I like WebTest because it's just an Ant task and I can run it right next to my JUnit and Cactus tests. For further automation, I use Anthill to schedule my tests.

There are many testing tools like MaxQ that can record mouse clicks, etc. but I'll leave that up to the QA department (now I just have to find one of those ;-).

Posted by Matt Raible on January 06, 2004 at 11:31 PM MST #

"it doesn't look like it would be possible to automate it" It supports playback, which can be integrated in the build.

Posted by Unknown on January 07, 2004 at 12:25 AM MST #

I like that tool very much but AFAIK Canoo Web Test is not Javascript ready. We have forms with more then one Submit button. If a button is pressed, the form's action attribute is exchanged by a little javascript and then the form is submitted by that script. With Canoo Web Test you cannot test such web pages :-(

Posted by Jochen on January 07, 2004 at 04:06 AM MST #

WebTest JavaScript support has improved remarkably in the interim

Posted by Paul King on May 24, 2005 at 06:54 PM MDT #

Post a Comment:
  • HTML Syntax: Allowed