Web Development Tips – automate the little things
I recall a colleague of mine mentioning several weeks ago that it’s annoying to have to log into RHQ every time you redeploy UI code that causes portal-war’s web context to reload. I completely agreed at the time, but it wasn’t until today that I finally got annoyed enough to look for a workaround myself. Here’s the solution I ended up with:
1) Use FireFox
2) Download and install GreaseMonkey
3) Install the AutoLogin script
4) Log into “http://localhost:7080/Login.do” and make sure to tell FF to remember your password
5) Test that auto-login is working properly by logging out of the application…you should be forwarded to the login page, which FF will automatically fill in with your saved credentials, and the grease monkey script will perform the login for you
This should also work when you get logged out due to session expiry. The expiry handler will redirect you back to /Login.do, which will now automatically log you back in and – on a best effort basis – redirect you back to the last “valid” page you were on. RHQ has a mechanism for recording the last couple of pages you visited (see WebUserTrackingFilter) and will try them in most-recently-visited order until it finds a page that doesn’t blow up with JSF’s “classic” ViewExpiredException. I discuss the details of how this mechanism works in my other post.
Note: if you ever want to log into localhost with a different user, all you have to do is click the GreaseMonkey icon (on the far right-hand side of the status bar at the bottom of your browser) and you’ll temporarily disable the AutoLogin script from executing.
How would you solve this? How have you solved this? I’m eager to read your post backs.
Have you tried the iMacros plugin, you could automate the entire process of logging-in and then actually uploading and submitting your file with it.
Shams
February 6, 2010 at 10:17 am
Hey good old pal, go for iMacros, the plugin is available for both Chrome and Firefox and offers a number of options such as exporting your pages for debugging in different formats.
I’ve used iMacros for a while now and the best of all is that you can export your scripts for other users and include it in your test cases.
Cheers,
/fmatar
Fady Matar
February 6, 2010 at 12:54 pm
I use LastPass as a password manager, it’s not quite meant for this purpose, but it would auto-login and is a lot simpler to set up.
Jeff
March 18, 2010 at 10:30 am